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 c80b281..7cd714b 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 79563df..5d70608 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 658b52d..8e2a015 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;