re PR c++/19004 (ICE in uses_template_parms at cp/pt.c:4860)

PR c++/19004
	* pt.c (uses_template_parms): Handle IDENTIFIER_NODE.
	(type_dependent_expression_p): Allow BASELINKs whose associated
	functions are simply a FUNCTION_DECL.

	PR c++/19004
	* g++.dg/template/nontype13.C: New test.

From-SVN: r103531
This commit is contained in:
Mark Mitchell 2005-08-26 19:35:13 +00:00 committed by Mark Mitchell
parent b84f46516b
commit b207d6e26f
4 changed files with 40 additions and 6 deletions

View File

@ -1,5 +1,10 @@
2005-08-26 Mark Mitchell <mark@codesourcery.com>
PR c++/19004
* pt.c (uses_template_parms): Handle IDENTIFIER_NODE.
(type_dependent_expression_p): Allow BASELINKs whose associated
functions are simply a FUNCTION_DECL.
PR c++/23491
* cp-tree.h (build_vec_init): Adjust prototype.
* init.c (perform_member_init): Adjust call to build_vec_init.
@ -9,11 +14,6 @@
default initialization of vector elements when set.
* typeck.c (build_modify_expr): Adjust call to build_vec_init.
PR c++/19004
* pt.c (uses_template_parms): Handle IDENTIFIER_NODE.
(type_dependent_expression_p): Allow BASELINKs whose associated
functions are simply a FUNCTION_DECL.
2005-08-25 Nathan Sidwell <nathan@codesourcery.com>
PR c++/20817

View File

@ -4956,6 +4956,7 @@ uses_template_parms (tree t)
|| TREE_CODE (t) == TEMPLATE_PARM_INDEX
|| TREE_CODE (t) == OVERLOAD
|| TREE_CODE (t) == BASELINK
|| TREE_CODE (t) == IDENTIFIER_NODE
|| CONSTANT_CLASS_P (t))
dependent_p = (type_dependent_expression_p (t)
|| value_dependent_expression_p (t));
@ -12356,7 +12357,8 @@ type_dependent_expression_p (tree expression)
return true;
expression = TREE_OPERAND (expression, 0);
}
gcc_assert (TREE_CODE (expression) == OVERLOAD);
gcc_assert (TREE_CODE (expression) == OVERLOAD
|| TREE_CODE (expression) == FUNCTION_DECL);
while (expression)
{

View File

@ -1,5 +1,8 @@
2005-08-26 Mark Mitchell <mark@codesourcery.com>
PR c++/19004
* g++.dg/template/nontype13.C: New test.
PR c++/23491
* g++.dg/init/new14.C: New test.
* g++.dg/expr/anew1.C: Do not XFAIL.

View File

@ -0,0 +1,29 @@
// PR c++/19004
template<typename T>
struct Dummy
{
void evil()
{
this->template tester<true>();
}
template<bool B>
void tester()
{
bar<evil>()(); // { dg-error "argument" }
}
template<bool B>
struct bar
{
void operator()()
{ }
};
};
int main()
{
Dummy<int> d;
d.tester<true> (); // { dg-error "instantiated" }
}