re PR c++/29570 (ICE with brace-enclosed initializer)
PR c++/29570 * decl.c (cp_finish_decl): Check for value dependent brace enclosed scalar initializer. * g++.dg/template/static29.C: New test. From-SVN: r119045
This commit is contained in:
parent
4576ceaf22
commit
fd5b5108b0
4 changed files with 20 additions and 1 deletions
|
@ -1,5 +1,9 @@
|
|||
2006-11-21 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR c++/29570
|
||||
* decl.c (cp_finish_decl): Check for value dependent brace enclosed
|
||||
scalar initializer.
|
||||
|
||||
PR c++/29734
|
||||
* cp-tree.h (WANT_VECTOR): Define.
|
||||
(WANT_ARITH): Add WANT_VECTOR.
|
||||
|
|
|
@ -5058,7 +5058,14 @@ cp_finish_decl (tree decl, tree init, bool init_const_expr_p,
|
|||
|| !DECL_CLASS_SCOPE_P (decl)
|
||||
|| !DECL_INTEGRAL_CONSTANT_VAR_P (decl)
|
||||
|| type_dependent_p
|
||||
|| value_dependent_expression_p (init))
|
||||
|| value_dependent_expression_p (init)
|
||||
/* Check also if initializer is a value dependent
|
||||
{ integral_constant_expression }. */
|
||||
|| (TREE_CODE (init) == CONSTRUCTOR
|
||||
&& VEC_length (constructor_elt, CONSTRUCTOR_ELTS (init)) == 1
|
||||
&& value_dependent_expression_p
|
||||
(VEC_index (constructor_elt,
|
||||
CONSTRUCTOR_ELTS (init), 0)->value)))
|
||||
{
|
||||
if (init)
|
||||
DECL_INITIAL (decl) = init;
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
2006-11-21 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR c++/29570
|
||||
* g++.dg/template/static29.C: New test.
|
||||
|
||||
PR c++/29734
|
||||
* g++.dg/conversion/simd4.C: New test.
|
||||
|
||||
|
|
5
gcc/testsuite/g++.dg/template/static29.C
Normal file
5
gcc/testsuite/g++.dg/template/static29.C
Normal file
|
@ -0,0 +1,5 @@
|
|||
// PR c++/29570
|
||||
|
||||
template<int> struct A { static const int i; };
|
||||
|
||||
template<int N> const int A<N>::i = { A<N>::i };
|
Loading…
Add table
Reference in a new issue