PR c++/47220
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 16 Apr 2012 03:18:17 +0000 (03:18 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 16 Apr 2012 03:18:17 +0000 (03:18 +0000)
* pt.c (coerce_template_parameter_pack): Check for error_mark_node.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186480 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/ChangeLog
gcc/cp/pt.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/pr39639.C
gcc/testsuite/g++.dg/cpp0x/variadic126.C [new file with mode: 0644]
gcc/testsuite/g++.dg/debug/dwarf2/pr52260.C

index d37d42c..893ce56 100644 (file)
@@ -1,5 +1,8 @@
 2012-04-15  Jason Merrill  <jason@redhat.com>
 
+       PR c++/47220
+       * pt.c (coerce_template_parameter_pack): Check for error_mark_node.
+
        PR c++/52292
        PR c++/52380
        * pt.c (coerce_template_parms): Even if we aren't converting we
index 42dc0a7..95d0aba 100644 (file)
@@ -6697,7 +6697,12 @@ coerce_template_parameter_pack (tree parms,
             TREE_VEC_ELT (packed_types, arg_idx - parm_idx);
         }
 
-      if (arg != error_mark_node)
+      if (arg == error_mark_node)
+       {
+         if (complain & tf_error)
+           error ("template argument %d is invalid", arg_idx + 1);
+       }
+      else
        arg = convert_template_argument (actual_parm, 
                                         arg, new_args, complain, parm_idx,
                                         in_decl);
index a936b36..321adb3 100644 (file)
@@ -1,5 +1,8 @@
 2012-04-15  Jason Merrill  <jason@redhat.com>
 
+       PR c++/47220
+       * g++.dg/cpp0x/variadic126.C: New.
+
        PR c++/52380
        * g++.dg/cpp0x/variadic125.C: New.
 
index 4fd8b56..0838a0b 100644 (file)
@@ -2,6 +2,7 @@
 // Origin: PR c++/39639
 // { dg-do compile }
 // { dg-options "-std=c++0x" }
+// { dg-prune-output "template argument 1 is invalid" }
 
 template <class... Types>
 struct S
diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic126.C b/gcc/testsuite/g++.dg/cpp0x/variadic126.C
new file mode 100644 (file)
index 0000000..513c7e5
--- /dev/null
@@ -0,0 +1,8 @@
+// PR c++/47220
+// { dg-do compile { target c++11 } }
+
+template < typename ... > struct A;
+
+struct B : A <                 // { dg-error "invalid" }
+{
+};
index 9ab2589..024afc8 100644 (file)
@@ -22,7 +22,7 @@ namespace A
 {
   template <typename T>
   struct I : H <T> {};
-  template <typename ...> struct J;
+  template <typename ...> struct J {};
   template <typename> struct K;
   struct L
   {
@@ -36,7 +36,7 @@ namespace A
   template <typename T, typename B2, typename ... B4>
   struct N <T (B4 ...), B2> : L::M <B2> {};
   template <typename T, typename ... B4>
-  struct K <T (B4 ...)> :J <,>, L
+  struct K <T (B4 ...)> :J <>, L
   {
     typedef T O (B4 ...);
     struct P {};