Commit e0ef0af5 by Jason Merrill Committed by Jason Merrill

re PR c++/56684 ([C++0x] ICE: unexpected expression 'T' of kind template_parm_index)

	PR c++/56684
	* pt.c (instantiation_dependent_r): Check DECL_INITIAL of VAR_DECL
	and CONST_DECL.

From-SVN: r196983
parent 23b7850d
2013-03-22 Jason Merrill <jason@redhat.com>
PR c++/56684
* pt.c (instantiation_dependent_r): Check DECL_INITIAL of VAR_DECL
and CONST_DECL.
2013-03-21 Gabriel Dos Reis <gdr@integrable-solutions.net> 2013-03-21 Gabriel Dos Reis <gdr@integrable-solutions.net>
* cp-tree.h (identifier_p): New. * cp-tree.h (identifier_p): New.
......
...@@ -19942,6 +19942,13 @@ instantiation_dependent_r (tree *tp, int *walk_subtrees, ...@@ -19942,6 +19942,13 @@ instantiation_dependent_r (tree *tp, int *walk_subtrees,
case TREE_VEC: case TREE_VEC:
return NULL_TREE; return NULL_TREE;
case VAR_DECL:
case CONST_DECL:
/* A constant with a dependent initializer is dependent. */
if (value_dependent_expression_p (*tp))
return *tp;
break;
case TEMPLATE_PARM_INDEX: case TEMPLATE_PARM_INDEX:
return *tp; return *tp;
......
// PR c++/56684
template < int T > struct S
{
static const int Ti = T;
S() { 1 << Ti; }
};
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