aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/pt.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2011-05-26 09:22:51 -0400
committerJason Merrill <jason@gcc.gnu.org>2011-05-26 09:22:51 -0400
commitb613992600ec23a017a1c1d2c82adf0fe06cdd92 (patch)
tree032f35fe761d116c8c7bbd078092468e73c62951 /gcc/cp/pt.c
parentd11bf18f560999725b1fbbb393f7d12a1b751a59 (diff)
downloadgcc-b613992600ec23a017a1c1d2c82adf0fe06cdd92.zip
gcc-b613992600ec23a017a1c1d2c82adf0fe06cdd92.tar.gz
gcc-b613992600ec23a017a1c1d2c82adf0fe06cdd92.tar.bz2
re PR c++/48424 (C++0x parameter packs expansion problem)
PR c++/48424 * decl.c (grokparms): Function parameter packs don't need to go at the end. * pt.c (type_unification_real): But they aren't deduced otherwise. From-SVN: r174285
Diffstat (limited to 'gcc/cp/pt.c')
-rw-r--r--gcc/cp/pt.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index c9c25cd2..ab48c8f 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -14262,11 +14262,24 @@ type_unification_real (tree tparms,
while (parms && parms != void_list_node
&& ia < nargs)
{
- if (TREE_CODE (TREE_VALUE (parms)) == TYPE_PACK_EXPANSION)
- break;
-
parm = TREE_VALUE (parms);
+
+ if (TREE_CODE (parm) == TYPE_PACK_EXPANSION
+ && (!TREE_CHAIN (parms) || TREE_CHAIN (parms) == void_list_node))
+ /* For a function parameter pack that occurs at the end of the
+ parameter-declaration-list, the type A of each remaining
+ argument of the call is compared with the type P of the
+ declarator-id of the function parameter pack. */
+ break;
+
parms = TREE_CHAIN (parms);
+
+ if (TREE_CODE (parm) == TYPE_PACK_EXPANSION)
+ /* For a function parameter pack that does not occur at the
+ end of the parameter-declaration-list, the type of the
+ parameter pack is a non-deduced context. */
+ continue;
+
arg = args[ia];
++ia;
arg_expr = NULL;