* pt.c (any_pack_expanson_args_p): New.
(coerce_template_parms): Use it.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_7-branch@186436
138bc75d-0d04-0410-961f-
82ee72b054a4
+2012-04-13 Jason Merrill <jason@redhat.com>
+
+ PR c++/52824
+ * pt.c (any_pack_expanson_args_p): New.
+ (coerce_template_parms): Use it.
+
2012-04-11 Jason Merrill <jason@redhat.com>
PR c++/52906
return argument_pack;
}
+/* Returns true if the template argument vector ARGS contains
+ any pack expansions, false otherwise. */
+
+static bool
+any_pack_expanson_args_p (tree args)
+{
+ int i;
+ if (args)
+ for (i = 0; i < TREE_VEC_LENGTH (args); ++i)
+ if (PACK_EXPANSION_P (TREE_VEC_ELT (args, i)))
+ return true;
+ return false;
+}
+
/* Convert all template arguments to their appropriate types, and
return a vector containing the innermost resulting template
arguments. If any error occurs, return error_mark_node. Error and
if ((nargs > nparms && !variadic_p)
|| (nargs < nparms - variadic_p
&& require_all_args
+ && !any_pack_expanson_args_p (inner_args)
&& (!use_default_args
|| (TREE_VEC_ELT (parms, nargs) != error_mark_node
&& !TREE_PURPOSE (TREE_VEC_ELT (parms, nargs))))))
+2012-04-13 Jason Merrill <jason@redhat.com>
+
+ PR c++/52824
+ * g++.dg/cpp0x/variadic123.C: New.
+ * g++.dg/cpp0x/alias-decl-15.C: Remove dg-errors.
+
2012-04-11 Jason Merrill <jason@redhat.com>
PR c++/52906
// { dg-options "-std=c++0x" }
template<class U, class V> //#1
-struct foo {}; // { dg-error "provided for|foo" }
+struct foo {};
template<class U, class V=char>
struct P {};
template<template<class... U> class... TT>
struct bar {
template<class... Args>
- using mem = P<TT<Args...>...>;//#2 { dg-error "wrong number of|arguments" }
+ using mem = P<TT<Args...>...>;//#2
};
-bar<foo>::mem<int, char> b;//#3 { dg-error "invalid type" }
+bar<foo>::mem<int, char> b;//#3
--- /dev/null
+// PR c++/52824
+// { dg-do compile { target c++11 } }
+
+template<typename G, typename H>
+struct foo
+{};
+
+template<typename... G>
+struct bar : foo<G...>
+{};
+
+int main() {
+ bar<int, float> f;
+}