Commit 7c8233ce by Jason Merrill Committed by Jason Merrill

re PR c++/53836 (ICE: unexpected expression of kind template_parm_index)

	PR c++/53836
	* pt.c (value_dependent_expression_p): A TREE_LIST initializer must
	be dependent.

From-SVN: r191261
parent c915f8bc
2012-09-13 Jason Merrill <jason@redhat.com>
PR c++/53836
* pt.c (value_dependent_expression_p): A TREE_LIST initializer must
be dependent.
2012-09-10 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/54541
......
......@@ -19199,10 +19199,15 @@ value_dependent_expression_p (tree expression)
case VAR_DECL:
/* A constant with literal type and is initialized
with an expression that is value-dependent. */
with an expression that is value-dependent.
Note that a non-dependent parenthesized initializer will have
already been replaced with its constant value, so if we see
a TREE_LIST it must be dependent. */
if (DECL_INITIAL (expression)
&& decl_constant_var_p (expression)
&& value_dependent_expression_p (DECL_INITIAL (expression)))
&& (TREE_CODE (DECL_INITIAL (expression)) == TREE_LIST
|| value_dependent_expression_p (DECL_INITIAL (expression))))
return true;
return false;
......
2012-09-13 Jason Merrill <jason@redhat.com>
PR c++/53836
* g++.dg/template/init10.C: New.
2012-09-13 Tobias Burnus <burnus@net-b.de>
PR fortran/54556
......
template <int N>
struct A { };
template <int Q>
void g()
{
const int M ( Q );
A<M> a;
}
void h()
{
g<3>();
}
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