re PR c++/31517 (ICE on invalid initialization of static member of a template class)
2007-04-17 Simon Martin <simartin@users.sourceforge.net> PR c++/31517 * pt.c (value_dependent_expression_p): Handle MODOP_EXPRs. From-SVN: r123923
This commit is contained in:
parent
ce217d7583
commit
f01ec37df9
4 changed files with 23 additions and 0 deletions
|
@ -1,3 +1,8 @@
|
|||
2007-04-17 Simon Martin <simartin@users.sourceforge.net>
|
||||
|
||||
PR c++/31517
|
||||
* pt.c (value_dependent_expression_p): Handle MODOP_EXPRs.
|
||||
|
||||
2007-04-16 Seongbae Park <seongbae.park@gmail.com>
|
||||
|
||||
PR c++/29365
|
||||
|
|
|
@ -14949,6 +14949,10 @@ value_dependent_expression_p (tree expression)
|
|||
|| (type2 ? dependent_type_p (type2) : false));
|
||||
}
|
||||
|
||||
case MODOP_EXPR:
|
||||
return ((value_dependent_expression_p (TREE_OPERAND (expression, 0)))
|
||||
|| (value_dependent_expression_p (TREE_OPERAND (expression, 2))));
|
||||
|
||||
default:
|
||||
/* A constant expression is value-dependent if any subexpression is
|
||||
value-dependent. */
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
2007-04-17 Simon Martin <simartin@users.sourceforge.net>
|
||||
|
||||
PR c++/31517
|
||||
* g++.dg/template/init7.C: New test.
|
||||
|
||||
2007-04-17 Zdenek Dvorak <dvorakz@suse.cz>
|
||||
|
||||
PR rtl-optimization/31360
|
||||
|
|
9
gcc/testsuite/g++.dg/template/init7.C
Normal file
9
gcc/testsuite/g++.dg/template/init7.C
Normal file
|
@ -0,0 +1,9 @@
|
|||
/* PR c++/31517. This used to ICE. */
|
||||
/* { dg-do "compile" } */
|
||||
|
||||
template<typename> struct A
|
||||
{
|
||||
static const int i=0;
|
||||
};
|
||||
|
||||
template<typename T> const int A<T>::i = 0=0; /* { dg-error "duplicate initialization" } */
|
Loading…
Add table
Reference in a new issue