From: Paolo Carlini Date: Tue, 8 May 2018 19:35:10 +0000 (+0000) Subject: re PR c++/84588 (internal compiler error: Segmentation fault (contains_struct_check())) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9f171abdbcdb944e317ddee480d62b4dc7ce6cbf;p=gcc.git re PR c++/84588 (internal compiler error: Segmentation fault (contains_struct_check())) /cp 2018-05-08 Paolo Carlini PR c++/84588 * parser.c (cp_parser_parameter_declaration_list): When the entire parameter-declaration-list is erroneous maybe call abort_fully_implicit_template. /testsuite 2018-05-08 Paolo Carlini PR c++/84588 * g++.dg/cpp1y/pr84588.C: New. From-SVN: r260050 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index d80c15d2168..aa42de2c05f 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,10 @@ +2018-05-08 Paolo Carlini + + PR c++/84588 + * parser.c (cp_parser_parameter_declaration_list): When the + entire parameter-declaration-list is erroneous maybe call + abort_fully_implicit_template. + 2018-05-08 Marek Polacek PR c++/85695 diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index f8ecf030c0d..59829f3a7fe 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -21344,6 +21344,8 @@ cp_parser_parameter_declaration_list (cp_parser* parser, bool *is_error) { *is_error = true; parameters = error_mark_node; + if (parser->fully_implicit_function_template_p) + abort_fully_implicit_template (parser); break; } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 3bfeb894b9b..68c0033b511 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-05-08 Paolo Carlini + + PR c++/84588 + * g++.dg/cpp1y/pr84588.C: New. + 2018-05-08 Marek Polacek PR c++/85695 diff --git a/gcc/testsuite/g++.dg/cpp1y/pr84588.C b/gcc/testsuite/g++.dg/cpp1y/pr84588.C new file mode 100644 index 00000000000..9d7f9027b45 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1y/pr84588.C @@ -0,0 +1,10 @@ +// { dg-do compile { target c++14 } } +// { dg-options "-w" } + +struct a { + void b() {} + void c(auto = [] { + if (a a(int auto){}) // { dg-error "two or more data types" } + ; + }) {} +};