* tree.c (cp_build_qualified_type_real): Handle TYPE_PACK_EXPANSION
qualification by creating qualified PACK_EXPANSION_PATTERN and
then calling make_pack_expansion on it.
* g++.dg/cpp0x/variadic80.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@128861
138bc75d-0d04-0410-961f-
82ee72b054a4
+2007-09-28 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/31434
+ * tree.c (cp_build_qualified_type_real): Handle TYPE_PACK_EXPANSION
+ qualification by creating qualified PACK_EXPANSION_PATTERN and
+ then calling make_pack_expansion on it.
+
2007-09-28 Jie Zhang <jie.zhang@analog.com>
* config.gcc (bfin*-linux-uclibc*): Set extra_parts
t = cp_build_qualified_type_real (t, type_quals, complain);
return build_ptrmemfunc_type (t);
}
+ else if (TREE_CODE (type) == TYPE_PACK_EXPANSION)
+ {
+ tree t = PACK_EXPANSION_PATTERN (type);
+
+ t = cp_build_qualified_type_real (t, type_quals, complain);
+ return make_pack_expansion (t);
+ }
/* A reference or method type shall not be cv qualified.
[dcl.ref], [dct.fct] */
+2007-09-28 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/31434
+ * g++.dg/cpp0x/variadic80.C: New test.
+
2007-09-27 Jerry DeLisle <jvdelisle@gcc.gnu.org>
* gfortran.dg/namelist_38.f90: Delete test for revertion of
--- /dev/null
+// PR c++/31434
+// { dg-do run }
+// { dg-options "-std=c++0x" }
+
+extern "C" void abort ();
+
+template<typename... T> inline int foo (const T...) { return 1; }
+template<typename... T> inline int foo (const T *...) { return 2; }
+
+void
+bar (int *a)
+{
+ a[0] = foo (0);
+ a[1] = foo (*a);
+ a[2] = foo<int> (a);
+ a[3] = foo<int> (2, 3, 4, 5);
+ a[4] = foo<int> (a, a + 1, a + 2);
+}
+
+int
+main ()
+{
+ int a[5];
+ bar (a);
+ if (a[0] != 1 || a[1] != 1 || a[2] != 2 || a[3] != 1 || a[4] != 2)
+ abort ();
+ return 0;
+}