OSDN Git Service

PR c++/49420
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 16 Jun 2011 22:05:46 +0000 (22:05 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 16 Jun 2011 22:05:46 +0000 (22:05 +0000)
* error.c (dump_template_argument): Don't try to omit default
template args from an argument pack.

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

gcc/cp/ChangeLog
gcc/cp/error.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/variadic112.C [new file with mode: 0644]

index 9ed5086..6523c94 100644 (file)
@@ -1,3 +1,9 @@
+2011-06-16  Jason Merrill  <jason@redhat.com>
+
+       PR c++/49420
+       * error.c (dump_template_argument): Don't try to omit default
+       template args from an argument pack.
+
 2011-06-15  H.J. Lu  <hongjiu.lu@intel.com>
 
        PR c++/49412
index 22470dc..7c90ec4 100644 (file)
@@ -147,7 +147,9 @@ static void
 dump_template_argument (tree arg, int flags)
 {
   if (ARGUMENT_PACK_P (arg))
-    dump_template_argument_list (ARGUMENT_PACK_ARGS (arg), flags);
+    dump_template_argument_list (ARGUMENT_PACK_ARGS (arg),
+                                /* No default args in argument packs.  */
+                                flags|TFF_NO_OMIT_DEFAULT_TEMPLATE_ARGUMENTS);
   else if (TYPE_P (arg) || TREE_CODE (arg) == TEMPLATE_DECL)
     dump_type (arg, flags & ~TFF_CLASS_KEY_OR_ENUM);
   else
index bea8721..6622a60 100644 (file)
@@ -1,3 +1,8 @@
+2011-06-16  Jason Merrill  <jason@redhat.com>
+
+       PR c++/49420
+       * g++.dg/cpp0x/variadic112.C: New.
+
 2011-06-16  Jeff Law <law@redhat.com>
 
        * gcc.dg/builtin-object-size-1.c: Update to handle chances from
diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic112.C b/gcc/testsuite/g++.dg/cpp0x/variadic112.C
new file mode 100644 (file)
index 0000000..1640657
--- /dev/null
@@ -0,0 +1,19 @@
+// PR c++/49420
+// { dg-options -std=c++0x }
+
+struct A { };
+
+template <class T> struct B
+{
+  typedef typename T::type type ; // { dg-error "no type" }
+};
+
+template <typename Array, typename... Args>
+typename B<Array>::type
+get(const Array& a, Args... args);
+
+int main()
+{
+  A a;
+  int x = get(a, 1, 2, 3);     // { dg-error "no match" }
+}