* init.c (perform_member_init): Cope with uninstantiated NSDMI.
From-SVN: r184877
This commit is contained in:
parent
743af85b75
commit
a491b7be7f
|
@ -1,5 +1,7 @@
|
|||
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
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
2012-03-03 Jason Merrill <jason@redhat.com>
|
||||
|
||||
* g++.dg/cpp0x/nsdmi-defer6.C: New.
|
||||
|
||||
Core 1270
|
||||
* g++.dg/cpp0x/initlist65.C: New.
|
||||
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
// { dg-do compile { target c++11 } }
|
||||
|
||||
struct A // { dg-error "non-static data member" }
|
||||
{
|
||||
int i = (A(), 42); // { dg-message "required here" }
|
||||
};
|
||||
|
||||
A a;
|
Loading…
Reference in New Issue