re PR c++/35243 (ICE with invalid initializer list in variadic template)
authorPaolo Carlini <paolo.carlini@oracle.com>
Thu, 29 May 2008 16:44:29 +0000 (16:44 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Thu, 29 May 2008 16:44:29 +0000 (16:44 +0000)
/cp
2008-05-29  Paolo Carlini  <paolo.carlini@oracle.com>

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

        PR c++/35243
        * g++.dg/cpp0x/vt-35243.C: New.

From-SVN: r136174

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

index f371d8ca0c3a751ad5a206112e9ed4a8f5f5aae1..f9b197144dc424e0028778aa39442d1c7748ba45 100644 (file)
@@ -1,3 +1,9 @@
+2008-05-29  Paolo Carlini  <paolo.carlini@oracle.com>
+
+        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  <matz@suse.de>
 
        PR c++/27975
index b13573ce43ce4f6f8b5cc53dd5b9715be2560b5d..95440c980230a43dd895f221b69c24b692ebc9b7 100644 (file)
@@ -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.  */
index 9df869d1709f0b8e22dfbce6a1f667c84c9da95f..bc5c61433abcb24bccfdb3ee66b74fe96eda76a1 100644 (file)
@@ -1,3 +1,8 @@
+2008-05-29  Paolo Carlini  <paolo.carlini@oracle.com>
+
+        PR c++/35243
+        * g++.dg/cpp0x/vt-35243.C: New.        
+
 2008-05-29  H.J. Lu  <hongjiu.lu@intel.com>
 
        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 (file)
index 0000000..4b55574
--- /dev/null
@@ -0,0 +1,9 @@
+// { dg-options "-std=c++0x" }
+struct A {};
+
+template<typename... T> struct B : T...
+{
+  B() : T(x)... {} // { dg-error "not declared" }
+};
+
+B<A> b;