Commit 483a1dce by Jason Merrill Committed by Jason Merrill

re PR c++/42387 (ICE with new expression in class template)

	PR c++/42387
	* decl.c (compute_array_index_type): Mark a VLA as dependent.

From-SVN: r155292
parent 6568e44a
2009-12-16 Jason Merrill <jason@redhat.com>
PR c++/42387
* decl.c (compute_array_index_type): Mark a VLA as dependent.
2009-12-15 Jason Merrill <jason@redhat.com>
PR c++/42358
......
......@@ -7270,11 +7270,8 @@ compute_array_index_type (tree name, tree size)
structural equality checks. */
itype = build_index_type (build_min (MINUS_EXPR, sizetype,
size, integer_one_node));
if (!TREE_SIDE_EFFECTS (size))
{
TYPE_DEPENDENT_P (itype) = 1;
TYPE_DEPENDENT_P_VALID (itype) = 1;
}
TYPE_DEPENDENT_P (itype) = 1;
TYPE_DEPENDENT_P_VALID (itype) = 1;
SET_TYPE_STRUCTURAL_EQUALITY (itype);
return itype;
}
......
2009-12-15 Jason Merrill <jason@redhat.com>
PR c++/42387
* g++.dg/ext/vla8.C: New.
2009-12-16 Jakub Jelinek <jakub@redhat.com>
* gcc.c-torture/compile/20091215-1.c: New test.
......
// PR c++/42387
// { dg-options "" }
template<class PF>
struct AvlTreeIter
{
int Num();
AvlTreeIter()
{
new (void* [Num()]);
}
};
AvlTreeIter<int> a;
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