From: Paolo Carlini Date: Wed, 19 Sep 2018 19:35:19 +0000 (+0000) Subject: re PR c++/87324 (g++ ICE with overriding initializers: Segmentation fault) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ff5c3c9d38ec89c2fdab4b947676e45f4ffdf61e;p=gcc.git re PR c++/87324 (g++ ICE with overriding initializers: Segmentation fault) /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. From-SVN: r264428 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 7fcb34605c1..546943c9a0e 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 f5e4fa4ff07..6e68f2c41dc 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 4631448bb67..f3b55d157f8 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 00000000000..ed276291758 --- /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" }