re PR c++/84630 (ICE: TYPE_NAME() used on error_mark_node in tsubst_lambda_expr,...
authorPaolo Carlini <paolo.carlini@oracle.com>
Wed, 18 Apr 2018 08:03:45 +0000 (08:03 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Wed, 18 Apr 2018 08:03:45 +0000 (08:03 +0000)
/cp
2018-04-18  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/84630
* pt.c (tsubst_lambda_expr): Check begin_lambda_type return value
for error_mark_node.

/testsuite
2018-04-18  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/84630
* g++.dg/cpp0x/pr84630.C: New.

From-SVN: r259460

gcc/cp/ChangeLog
gcc/cp/pt.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/pr84630.C [new file with mode: 0644]

index c80b281d3130ae317b84e827f1bbaa2897592b5f..7cd714b9e3add61b86d8beacf4794fb771d93282 100644 (file)
@@ -1,3 +1,9 @@
+2018-04-18  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/84630
+       * pt.c (tsubst_lambda_expr): Check begin_lambda_type return value
+       for error_mark_node.
+
 2018-04-18  Jakub Jelinek  <jakub@redhat.com>
 
        PR c++/84463
index 79563dfa5334b128c412e09180caf4089f2eb497..5d7060858b952ae785716e9c681a7f297f57c25b 100644 (file)
@@ -17570,6 +17570,8 @@ tsubst_lambda_expr (tree t, tree args, tsubst_flags_t complain, tree in_decl)
     }
 
   tree type = begin_lambda_type (r);
+  if (type == error_mark_node)
+    return error_mark_node;
 
   /* Do this again now that LAMBDA_EXPR_EXTRA_SCOPE is set.  */
   determine_visibility (TYPE_NAME (type));
index 658b52de5272d8812fda1604c881a46a4a2033bc..8e2a0156f6ee39098547bd0536666f6dbc3512bf 100644 (file)
@@ -1,3 +1,8 @@
+2018-04-18  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/84630
+       * g++.dg/cpp0x/pr84630.C: New.
+
 2018-04-18  Jakub Jelinek  <jakub@redhat.com>
 
        PR c++/84463
diff --git a/gcc/testsuite/g++.dg/cpp0x/pr84630.C b/gcc/testsuite/g++.dg/cpp0x/pr84630.C
new file mode 100644 (file)
index 0000000..3c2b4e4
--- /dev/null
@@ -0,0 +1,7 @@
+// PR c++/84630
+// { dg-do compile { target c++11 } }
+
+template <typename...> struct c {
+  template <int> __attribute__((noinline([] {}))) int b();  // { dg-error "wrong number of arguments" }
+};
+c<> a;