summaryrefslogtreecommitdiff
path: root/gcc/cp/init.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/init.c')
-rw-r--r--gcc/cp/init.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/cp/init.c b/gcc/cp/init.c
index 2355a04de23..1b2a1ef15ae 100644
--- a/gcc/cp/init.c
+++ b/gcc/cp/init.c
@@ -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