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
This commit is contained in:
parent
6568e44adf
commit
483a1dce8a
@ -1,3 +1,8 @@
|
||||
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;
|
||||
}
|
||||
|
@ -1,3 +1,8 @@
|
||||
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.
|
||||
|
15
gcc/testsuite/g++.dg/ext/vla8.C
Normal file
15
gcc/testsuite/g++.dg/ext/vla8.C
Normal file
@ -0,0 +1,15 @@
|
||||
// PR c++/42387
|
||||
// { dg-options "" }
|
||||
|
||||
template<class PF>
|
||||
struct AvlTreeIter
|
||||
{
|
||||
int Num();
|
||||
|
||||
AvlTreeIter()
|
||||
{
|
||||
new (void* [Num()]);
|
||||
}
|
||||
};
|
||||
|
||||
AvlTreeIter<int> a;
|
Loading…
Reference in New Issue
Block a user