case GE_EXPR:
case LT_EXPR:
case GT_EXPR:
- case ARRAY_REF:
case COMPOUND_EXPR:
case SCOPE_REF:
case DOTSTAR_EXPR:
(code, tsubst_copy (TREE_OPERAND (t, 0), args, complain, in_decl),
tsubst_copy (TREE_OPERAND (t, 1), args, complain, in_decl));
+ case ARRAY_REF:
+ return build_nt
+ (ARRAY_REF,
+ tsubst_copy (TREE_OPERAND (t, 0), args, complain, in_decl),
+ tsubst_copy (TREE_OPERAND (t, 1), args, complain, in_decl),
+ NULL_TREE, NULL_TREE);
+
case CALL_EXPR:
return build_nt (code,
tsubst_copy (TREE_OPERAND (t, 0), args,
case SCOPE_REF:
return tsubst_qualified_id (t, args, complain, in_decl, /*done=*/true,
/*address_p=*/false);
-
case ARRAY_REF:
- if (tsubst_copy (TREE_OPERAND (t, 0), args, complain, in_decl)
- == NULL_TREE)
- /* new-type-id */
- return build_nt (ARRAY_REF, NULL_TREE, RECUR (TREE_OPERAND (t, 1)),
- NULL_TREE, NULL_TREE);
-
op1 = tsubst_non_call_postfix_expression (TREE_OPERAND (t, 0),
args, complain, in_decl);
- /* Remember that there was a reference to this entity. */
- if (DECL_P (op1))
- mark_used (op1);
- return grok_array_decl (op1, RECUR (TREE_OPERAND (t, 1)));
-
+ return build_x_binary_op (ARRAY_REF, op1, RECUR (TREE_OPERAND (t, 1)),
+ /*overloaded_p=*/NULL);
+
case SIZEOF_EXPR:
case ALIGNOF_EXPR:
op1 = TREE_OPERAND (t, 0);
--- /dev/null
+// Copyright (C) 2005 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 5 Jan 2005 <nathan@codesourcery.com>
+
+// PR 19270: ICE
+// Origin: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+
+template<class T> struct Vec {
+ T* data;
+ T& operator[](int i) const;
+};
+
+template<class T> inline T& Vec<T>::operator[](int i) const
+{
+ return (&data[0])[i];
+}
+
+inline double foo(Vec<double> v)
+{
+ return v[0];
+}