diff options
Diffstat (limited to 'gcc/cp/parser.c')
-rw-r--r-- | gcc/cp/parser.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index e13e127..35f4e36 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -22101,8 +22101,10 @@ cp_parser_initializer_list (cp_parser* parser, bool* non_constant_p) if (!cp_parser_parse_definitely (parser)) designator = NULL_TREE; - else if (non_const) - require_potential_rvalue_constant_expression (designator); + else if (non_const + && (!require_potential_rvalue_constant_expression + (designator))) + designator = NULL_TREE; if (designator) /* Warn the user that they are using an extension. */ pedwarn (loc, OPT_Wpedantic, |