2012-03-03 Jason Merrill <jason@redhat.com>
+ * init.c (perform_member_init): Cope with uninstantiated NSDMI.
+
Core 1270
* call.c (build_aggr_conv): Call reshape_init.
(convert_like_real): Likewise.
else
{
init = DECL_INITIAL (member);
+ if (init && TREE_CODE (init) == DEFAULT_ARG)
+ {
+ error ("constructor required before non-static data member "
+ "for %qD has been parsed", member);
+ init = NULL_TREE;
+ }
/* Strip redundant TARGET_EXPR so we don't need to remap it, and
so the aggregate init code below will see a CONSTRUCTOR. */
if (init && TREE_CODE (init) == TARGET_EXPR
2012-03-03 Jason Merrill <jason@redhat.com>
+ * g++.dg/cpp0x/nsdmi-defer6.C: New.
+
Core 1270
* g++.dg/cpp0x/initlist65.C: New.
--- /dev/null
+// { dg-do compile { target c++11 } }
+
+struct A // { dg-error "non-static data member" }
+{
+ int i = (A(), 42); // { dg-message "required here" }
+};
+
+A a;