From: Paolo Carlini Date: Wed, 18 Apr 2018 08:03:45 +0000 (+0000) Subject: re PR c++/84630 (ICE: TYPE_NAME() used on error_mark_node in tsubst_lambda_expr,... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c18a88c50a0d65cb230644755a9d8bc25a34810e;p=gcc.git re PR c++/84630 (ICE: TYPE_NAME() used on error_mark_node in tsubst_lambda_expr, at cp/pt.c:17141) /cp 2018-04-18 Paolo Carlini PR c++/84630 * pt.c (tsubst_lambda_expr): Check begin_lambda_type return value for error_mark_node. /testsuite 2018-04-18 Paolo Carlini PR c++/84630 * g++.dg/cpp0x/pr84630.C: New. From-SVN: r259460 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index c80b281d313..7cd714b9e3a 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2018-04-18 Paolo Carlini + + PR c++/84630 + * pt.c (tsubst_lambda_expr): Check begin_lambda_type return value + for error_mark_node. + 2018-04-18 Jakub Jelinek PR c++/84463 diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 79563dfa533..5d7060858b9 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -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)); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 658b52de527..8e2a0156f6e 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-04-18 Paolo Carlini + + PR c++/84630 + * g++.dg/cpp0x/pr84630.C: New. + 2018-04-18 Jakub Jelinek 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 index 00000000000..3c2b4e46e34 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/pr84630.C @@ -0,0 +1,7 @@ +// PR c++/84630 +// { dg-do compile { target c++11 } } + +template struct c { + template __attribute__((noinline([] {}))) int b(); // { dg-error "wrong number of arguments" } +}; +c<> a;