re PR c++/40619 ([c++0x] ICE on repeated decltype expression in auto functions)

PR c++/40619
	* tree.c (cp_tree_equal) [PARM_DECL]: Don't check parm index.

From-SVN: r149240
This commit is contained in:
Jason Merrill 2009-07-04 14:11:59 -04:00 committed by Jason Merrill
parent 8fbe4fa1e1
commit 06b84a6476
3 changed files with 13 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2009-07-04 Jason Merrill <jason@redhat.com>
PR c++/40619
* tree.c (cp_tree_equal) [PARM_DECL]: Don't check parm index.
2009-06-30 Jason Merrill <jason@redhat.com>
PR c++/40595

View File

@ -1880,8 +1880,7 @@ cp_tree_equal (tree t1, tree t2)
case PARM_DECL:
/* For comparing uses of parameters in late-specified return types
with an out-of-class definition of the function. */
if (same_type_p (TREE_TYPE (t1), TREE_TYPE (t2))
&& parm_index (t1) == parm_index (t2))
if (same_type_p (TREE_TYPE (t1), TREE_TYPE (t2)))
return true;
else
return false;

View File

@ -0,0 +1,7 @@
// PR c++/40619
// { dg-options "-std=c++0x" }
template<typename U> struct X {};
template<typename T> auto f(T t) -> X<decltype(t+1)> {}
template<typename T> auto g(T t) -> X<decltype(t+1)> {}