aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/parser.c
diff options
context:
space:
mode:
authorPaolo Carlini <paolo.carlini@oracle.com>2017-12-19 22:14:59 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2017-12-19 22:14:59 +0000
commit1c97d579f228a3ccfb2e08377eb387b904194911 (patch)
tree1795a7bd35f6078e54a3ebd2b9182ad6e5c71498 /gcc/cp/parser.c
parent5837edca5cf5eb7cc45a2a61f69543264b50bbc8 (diff)
downloadgcc-1c97d579f228a3ccfb2e08377eb387b904194911.zip
gcc-1c97d579f228a3ccfb2e08377eb387b904194911.tar.gz
gcc-1c97d579f228a3ccfb2e08377eb387b904194911.tar.bz2
re PR c++/82593 (Internal compiler error: in process_init_constructor_array, at cp/typeck2.c:1294)
/cp 2017-12-19 Paolo Carlini <paolo.carlini@oracle.com> PR c++/82593 * decl.c (check_array_designated_initializer): Not static. * cp-tree.h (check_array_designated_initializer): Declare. * typeck2.c (process_init_constructor_array): Call the latter. * parser.c (cp_parser_initializer_list): Check the return value of require_potential_rvalue_constant_expression. /testsuite 2017-12-19 Paolo Carlini <paolo.carlini@oracle.com> PR c++/82593 * g++.dg/cpp0x/desig2.C: New. * g++.dg/cpp0x/desig3.C: Likewise. * g++.dg/cpp0x/desig4.C: Likewise. From-SVN: r255845
Diffstat (limited to 'gcc/cp/parser.c')
-rw-r--r--gcc/cp/parser.c6
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,