Commit f01ec37d by Simon Martin Committed by Simon Martin

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
parent ce217d75
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> 2007-04-16 Seongbae Park <seongbae.park@gmail.com>
PR c++/29365 PR c++/29365
......
...@@ -14949,6 +14949,10 @@ value_dependent_expression_p (tree expression) ...@@ -14949,6 +14949,10 @@ value_dependent_expression_p (tree expression)
|| (type2 ? dependent_type_p (type2) : false)); || (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: default:
/* A constant expression is value-dependent if any subexpression is /* A constant expression is value-dependent if any subexpression is
value-dependent. */ value-dependent. */
......
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> 2007-04-17 Zdenek Dvorak <dvorakz@suse.cz>
PR rtl-optimization/31360 PR rtl-optimization/31360
/* 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" } */
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