Commit 625b6d91 by Douglas Gregor Committed by Doug Gregor

re PR c++/34050 (ICE derived classes and variadic templates)

2008-02-14  Douglas Gregor  <doug.gregor@gmail.com>

	PR c++/34050
	* pt.c (tsubst_initializer_list): Deal with the use of
	VOID_TYPE_NODE to indicate value-initialization of the bases.


2008-02-14  Douglas Gregor  <doug.gregor@gmail.com>

	PR c++/34050
	* g++.dg/cpp0x/vt-34050.C: New.

From-SVN: r132331
parent 512d1f4b
2008-02-14 Douglas Gregor <doug.gregor@gmail.com>
PR c++/34050
* pt.c (tsubst_initializer_list): Deal with the use of
VOID_TYPE_NODE to indicate value-initialization of the bases.
2008-02-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org> 2008-02-14 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
Jason Merrill <jason@redhat.com> Jason Merrill <jason@redhat.com>
......
...@@ -15190,37 +15190,49 @@ tsubst_initializer_list (tree t, tree argvec) ...@@ -15190,37 +15190,49 @@ tsubst_initializer_list (tree t, tree argvec)
PACK_EXPANSION_PARAMETER_PACKS (expr) = PACK_EXPANSION_PARAMETER_PACKS (expr) =
PACK_EXPANSION_PARAMETER_PACKS (TREE_PURPOSE (t)); PACK_EXPANSION_PARAMETER_PACKS (TREE_PURPOSE (t));
/* Substitute parameter packs into each argument in the if (TREE_VALUE (t) == void_type_node)
TREE_LIST. */ /* VOID_TYPE_NODE is used to indicate
in_base_initializer = 1; value-initialization. */
for (arg = TREE_VALUE (t); arg; arg = TREE_CHAIN (arg)) {
{ for (i = 0; i < len; i++)
tree expanded_exprs; TREE_VEC_ELT (expanded_arguments, i) = void_type_node;
}
/* Expand the argument. */ else
SET_PACK_EXPANSION_PATTERN (expr, TREE_VALUE (arg)); {
expanded_exprs = tsubst_pack_expansion (expr, argvec, /* Substitute parameter packs into each argument in the
tf_warning_or_error, TREE_LIST. */
NULL_TREE); in_base_initializer = 1;
for (arg = TREE_VALUE (t); arg; arg = TREE_CHAIN (arg))
/* Prepend each of the expanded expressions to the {
corresponding TREE_LIST in EXPANDED_ARGUMENTS. */ tree expanded_exprs;
for (i = 0; i < len; i++)
{ /* Expand the argument. */
TREE_VEC_ELT (expanded_arguments, i) = SET_PACK_EXPANSION_PATTERN (expr, TREE_VALUE (arg));
tree_cons (NULL_TREE, TREE_VEC_ELT (expanded_exprs, i), expanded_exprs
TREE_VEC_ELT (expanded_arguments, i)); = tsubst_pack_expansion (expr, argvec,
} tf_warning_or_error,
} NULL_TREE);
in_base_initializer = 0;
/* Prepend each of the expanded expressions to the
corresponding TREE_LIST in EXPANDED_ARGUMENTS. */
for (i = 0; i < len; i++)
{
TREE_VEC_ELT (expanded_arguments, i) =
tree_cons (NULL_TREE,
TREE_VEC_ELT (expanded_exprs, i),
TREE_VEC_ELT (expanded_arguments, i));
}
}
in_base_initializer = 0;
/* Reverse all of the TREE_LISTs in EXPANDED_ARGUMENTS, /* Reverse all of the TREE_LISTs in EXPANDED_ARGUMENTS,
since we built them backwards. */ since we built them backwards. */
for (i = 0; i < len; i++) for (i = 0; i < len; i++)
{ {
TREE_VEC_ELT (expanded_arguments, i) = TREE_VEC_ELT (expanded_arguments, i) =
nreverse (TREE_VEC_ELT (expanded_arguments, i)); nreverse (TREE_VEC_ELT (expanded_arguments, i));
} }
}
} }
for (i = 0; i < len; ++i) for (i = 0; i < len; ++i)
......
2008-02-14 Douglas Gregor <doug.gregor@gmail.com>
PR c++/34050
* g++.dg/cpp0x/vt-34050.C: New.
2008-02-14 Danny Smith <dannysmith@users.sourceforge.net> 2008-02-14 Danny Smith <dannysmith@users.sourceforge.net>
PR preprocessor/35061 PR preprocessor/35061
// { dg-options "-std=c++0x" }
struct A {};
template<typename... T> struct B : T...
{
B() : T()... {}
};
B<A> b;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment