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
This commit is contained in:
Douglas Gregor 2008-02-15 03:09:18 +00:00 committed by Doug Gregor
parent 512d1f4b7d
commit 625b6d91e7
4 changed files with 60 additions and 28 deletions

View File

@ -1,3 +1,9 @@
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>

View File

@ -15190,6 +15190,15 @@ 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));
if (TREE_VALUE (t) == void_type_node)
/* VOID_TYPE_NODE is used to indicate
value-initialization. */
{
for (i = 0; i < len; i++)
TREE_VEC_ELT (expanded_arguments, i) = void_type_node;
}
else
{
/* Substitute parameter packs into each argument in the /* Substitute parameter packs into each argument in the
TREE_LIST. */ TREE_LIST. */
in_base_initializer = 1; in_base_initializer = 1;
@ -15199,7 +15208,8 @@ tsubst_initializer_list (tree t, tree argvec)
/* Expand the argument. */ /* Expand the argument. */
SET_PACK_EXPANSION_PATTERN (expr, TREE_VALUE (arg)); SET_PACK_EXPANSION_PATTERN (expr, TREE_VALUE (arg));
expanded_exprs = tsubst_pack_expansion (expr, argvec, expanded_exprs
= tsubst_pack_expansion (expr, argvec,
tf_warning_or_error, tf_warning_or_error,
NULL_TREE); NULL_TREE);
@ -15208,7 +15218,8 @@ tsubst_initializer_list (tree t, tree argvec)
for (i = 0; i < len; i++) for (i = 0; i < len; i++)
{ {
TREE_VEC_ELT (expanded_arguments, i) = TREE_VEC_ELT (expanded_arguments, i) =
tree_cons (NULL_TREE, TREE_VEC_ELT (expanded_exprs, i), tree_cons (NULL_TREE,
TREE_VEC_ELT (expanded_exprs, i),
TREE_VEC_ELT (expanded_arguments, i)); TREE_VEC_ELT (expanded_arguments, i));
} }
} }
@ -15222,6 +15233,7 @@ tsubst_initializer_list (tree t, tree argvec)
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)
{ {

View File

@ -1,3 +1,8 @@
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

View File

@ -0,0 +1,9 @@
// { dg-options "-std=c++0x" }
struct A {};
template<typename... T> struct B : T...
{
B() : T()... {}
};
B<A> b;