re PR c++/84588 (internal compiler error: Segmentation fault (contains_struct_check()))
authorPaolo Carlini <paolo.carlini@oracle.com>
Tue, 8 May 2018 19:35:10 +0000 (19:35 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Tue, 8 May 2018 19:35:10 +0000 (19:35 +0000)
/cp
2018-05-08  Paolo Carlini  <paolo.carlini@oracle.com>

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  <paolo.carlini@oracle.com>

PR c++/84588
* g++.dg/cpp1y/pr84588.C: New.

From-SVN: r260050

gcc/cp/ChangeLog
gcc/cp/parser.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp1y/pr84588.C [new file with mode: 0644]

index d80c15d21684c2e2edd5d0b325b69863af2d9db3..aa42de2c05f2f21a9de241b5c3f59f3e29fc4b84 100644 (file)
@@ -1,3 +1,10 @@
+2018-05-08  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       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  <polacek@redhat.com>
 
        PR c++/85695
index f8ecf030c0d8bd2e88c1bcc39c85740717e0c287..59829f3a7fed0486202c891f0d86389a2672f087 100644 (file)
@@ -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;
        }
 
index 3bfeb894b9b46dd62da15ad955f9e1cd569e2516..68c0033b511d40e00350872a636ac49be745cd91 100644 (file)
@@ -1,3 +1,8 @@
+2018-05-08  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/84588
+       * g++.dg/cpp1y/pr84588.C: New.
+
 2018-05-08  Marek Polacek  <polacek@redhat.com>
 
        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 (file)
index 0000000..9d7f902
--- /dev/null
@@ -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" }
+      ;
+  }) {}
+};