Commit a491b7be by Jason Merrill Committed by Jason Merrill

* init.c (perform_member_init): Cope with uninstantiated NSDMI.

From-SVN: r184877
parent 743af85b
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.
......
......@@ -540,6 +540,12 @@ perform_member_init (tree member, tree init)
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.
......
// { dg-do compile { target c++11 } }
struct A // { dg-error "non-static data member" }
{
int i = (A(), 42); // { dg-message "required here" }
};
A a;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment