aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2015-01-13 16:04:35 -0500
committerJason Merrill <jason@gcc.gnu.org>2015-01-13 16:04:35 -0500
commit7c368fb23cc92a3406e181ae361ebce3f5b9ab22 (patch)
treeb86b1028766e63f639af9a050d692e8db9f12d88 /gcc
parent8f413ae21e40877f5f6926d4de79966121edf501 (diff)
downloadgcc-7c368fb23cc92a3406e181ae361ebce3f5b9ab22.zip
gcc-7c368fb23cc92a3406e181ae361ebce3f5b9ab22.tar.gz
gcc-7c368fb23cc92a3406e181ae361ebce3f5b9ab22.tar.bz2
re PR c++/64514 (Error in template instantiation in GCC 4.9, works fine in GCC 4.8)
PR c++/64514 * pt.c (coerce_template_parameter_pack): Return NULL for a zero-length fixed parameter pack with a pack expansion arg. From-SVN: r219558
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog4
-rw-r--r--gcc/cp/pt.c3
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/variadic165.C17
3 files changed, 24 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 0e94fe1..668b13b 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,9 @@
2015-01-13 Jason Merrill <jason@redhat.com>
+ PR c++/64514
+ * pt.c (coerce_template_parameter_pack): Return NULL for a
+ zero-length fixed parameter pack with a pack expansion arg.
+
PR c++/64520
* pt.c (unify): Don't try to deduce to std::initializer_list<T...>.
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 3ac93db..55871e5 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -6825,6 +6825,9 @@ coerce_template_parameter_pack (tree parms,
if (invalid_nontype_parm_type_p (t, complain))
return error_mark_node;
}
+ /* We don't know how many args we have yet, just
+ use the unconverted ones for now. */
+ return NULL_TREE;
}
packed_args = make_tree_vec (TREE_VEC_LENGTH (packed_parms));
diff --git a/gcc/testsuite/g++.dg/cpp0x/variadic165.C b/gcc/testsuite/g++.dg/cpp0x/variadic165.C
new file mode 100644
index 0000000..862931f
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/variadic165.C
@@ -0,0 +1,17 @@
+// PR c++/64514
+// { dg-do compile { target c++11 } }
+
+template<typename... T>
+struct Functor
+{
+ template <T...>
+ struct Inner
+ {};
+};
+
+template struct Functor<>::Inner<>;
+
+int main()
+{
+
+}