From aecaad790a1111a2ad87aa03ed385981dbab7564 Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Thu, 29 May 2008 16:44:29 +0000 Subject: [PATCH] re PR c++/35243 (ICE with invalid initializer list in variadic template) /cp 2008-05-29 Paolo Carlini PR c++/35243 * pt.c (tsubst_initializer_list): Consistently check the tree returned by tsubst_pack_expansion for error_mark_node. /testsuite 2008-05-29 Paolo Carlini PR c++/35243 * g++.dg/cpp0x/vt-35243.C: New. From-SVN: r136174 --- gcc/cp/ChangeLog | 6 ++++++ gcc/cp/pt.c | 2 ++ gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/cpp0x/vt-35243.C | 9 +++++++++ 4 files changed, 22 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp0x/vt-35243.C diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index f371d8ca0c3..f9b197144dc 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2008-05-29 Paolo Carlini + + PR c++/35243 + * pt.c (tsubst_initializer_list): Consistently check the tree + returned by tsubst_pack_expansion for error_mark_node. + 2008-05-27 Michael Matz PR c++/27975 diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index b13573ce43c..95440c98023 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -15326,6 +15326,8 @@ tsubst_initializer_list (tree t, tree argvec) = tsubst_pack_expansion (expr, argvec, tf_warning_or_error, NULL_TREE); + if (expanded_exprs == error_mark_node) + continue; /* Prepend each of the expanded expressions to the corresponding TREE_LIST in EXPANDED_ARGUMENTS. */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 9df869d1709..bc5c61433ab 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2008-05-29 Paolo Carlini + + PR c++/35243 + * g++.dg/cpp0x/vt-35243.C: New. + 2008-05-29 H.J. Lu PR target/35771 diff --git a/gcc/testsuite/g++.dg/cpp0x/vt-35243.C b/gcc/testsuite/g++.dg/cpp0x/vt-35243.C new file mode 100644 index 00000000000..4b555744269 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/vt-35243.C @@ -0,0 +1,9 @@ +// { dg-options "-std=c++0x" } +struct A {}; + +template struct B : T... +{ + B() : T(x)... {} // { dg-error "not declared" } +}; + +B b; -- 2.30.2