* init.c (build_new): Allow enumeration types for the array-bounds
in a direct-new-declarator.
* semantics.c (finish_typeof): Resolve OFFSET_REFs.
From-SVN: r39817
2001-02-17 Mark Mitchell <mark@codesourcery.com>
+ * init.c (build_new): Allow enumeration types for the array-bounds
+ in a direct-new-declarator.
+
+ * semantics.c (finish_typeof): Resolve OFFSET_REFs.
+
* pt.c (check_explicit_specialization): Copy TREE_PRIVATE and
TREE_PROTECTED from the template being specialized.
}
else
{
- int flags = pedantic ? WANT_INT : (WANT_INT | WANT_ENUM);
- if (build_expr_type_conversion (flags, this_nelts, 0)
+ if (build_expr_type_conversion (WANT_INT | WANT_ENUM,
+ this_nelts, 0)
== NULL_TREE)
pedwarn ("size in array new must have integral type");
return t;
}
+ if (TREE_CODE (expr) == OFFSET_REF)
+ expr = resolve_offset_ref (expr);
+
return TREE_TYPE (expr);
}
--- /dev/null
+// Build don't link:
+// Origin: Mark Mitchell <mark@codesourcery.com>
+
+struct S
+{
+ int i; // ERROR - non-static data member
+ __typeof( S::i ) f (); // ERROR - referenced here
+};
--- /dev/null
+// Build don't link:
+// Origin: j_bouis@hotmail.com
+
+enum { FOO = 3 };
+int* arr = new int[FOO];