From: paolo Date: Wed, 19 Sep 2018 19:35:19 +0000 (+0000) Subject: /cp X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=63e624a208e973be4a2674cea9c332f1b4323bee;p=thirdparty%2Fgcc.git /cp 2018-09-19 Paolo Carlini PR c++/87324 * parser.c (cp_parser_initializer_list): Assign error_mark_node to the index upon error. /testsuite 2018-09-19 Paolo Carlini PR c++/87324 * g++.dg/cpp0x/desig5.C: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@264428 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 7fcb34605c11..546943c9a0eb 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2018-09-19 Paolo Carlini + + PR c++/87324 + * parser.c (cp_parser_initializer_list): Assign error_mark_node + to the index upon error. + 2018-09-19 Marek Polacek PR c++/87357 - missing -Wconversion warning diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index f5e4fa4ff073..6e68f2c41dc4 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -22394,7 +22394,7 @@ cp_parser_initializer_list (cp_parser* parser, bool* non_constant_p) "%<.%s%> designator used multiple times in " "the same initializer list", IDENTIFIER_POINTER (designator)); - (*v)[i].index = NULL_TREE; + (*v)[i].index = error_mark_node; } else IDENTIFIER_MARKED (designator) = 1; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 4631448bb67f..f3b55d157f80 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-09-19 Paolo Carlini + + PR c++/87324 + * g++.dg/cpp0x/desig5.C: New. + 2018-09-19 Paul Thomas PR fortran/84109 diff --git a/gcc/testsuite/g++.dg/cpp0x/desig5.C b/gcc/testsuite/g++.dg/cpp0x/desig5.C new file mode 100644 index 000000000000..ed2762917580 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/desig5.C @@ -0,0 +1,13 @@ +// PR c++/87324 +// { dg-do compile { target c++11 } } +// { dg-options "-Wno-pedantic" } + +struct { + struct { + double a; + struct { + short b; + }; + }; + int c; +} d{.a = 7, .a = 8.09}; // { dg-error "designator used multiple times in the same initializer list" }