re PR c++/54858 (ICE in cp_tree_equal)

PR c++/54858
	* tree.c (cp_tree_equal): Handle FIELD_DECL.

	* g++.dg/template/pr54858.C: New test.

From-SVN: r192221
This commit is contained in:
Jakub Jelinek 2012-10-08 21:42:06 +02:00 committed by Jakub Jelinek
parent e951b450f3
commit 669a155ab8
4 changed files with 34 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2012-10-08 Jakub Jelinek <jakub@redhat.com>
PR c++/54858
* tree.c (cp_tree_equal): Handle FIELD_DECL.
2012-10-03 Jakub Jelinek <jakub@redhat.com>
PR c++/54777

View File

@ -1,7 +1,7 @@
/* Language-dependent node constructors for parse phase of GNU compiler.
Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010, 2011
Free Software Foundation, Inc.
1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010, 2011,
2012 Free Software Foundation, Inc.
Hacked by Michael Tiemann (tiemann@cygnus.com)
This file is part of GCC.
@ -2366,6 +2366,7 @@ cp_tree_equal (tree t1, tree t2)
case VAR_DECL:
case CONST_DECL:
case FIELD_DECL:
case FUNCTION_DECL:
case TEMPLATE_DECL:
case IDENTIFIER_NODE:

View File

@ -1,3 +1,8 @@
2012-10-08 Jakub Jelinek <jakub@redhat.com>
PR c++/54858
* g++.dg/template/pr54858.C: New test.
2012-10-05 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/33763

View File

@ -0,0 +1,21 @@
// PR c++/54858
// { dg-do compile }
template <int> struct A {};
template <typename T, T *> struct B {};
template <typename D> struct C
{
A<0> c0; B<A<0>, &C::c0> d0; // { dg-error "could not convert template argument" }
A<0> c1; B<A<0>, &C::c1> d1; // { dg-error "could not convert template argument" }
A<0> c2; B<A<0>, &C::c2> d2; // { dg-error "could not convert template argument" }
A<0> c3; B<A<0>, &C::c3> d3; // { dg-error "could not convert template argument" }
A<0> c4; B<A<0>, &C::c4> d4; // { dg-error "could not convert template argument" }
A<0> c5; B<A<0>, &C::c5> d5; // { dg-error "could not convert template argument" }
A<0> c6; B<A<0>, &C::c6> d6; // { dg-error "could not convert template argument" }
A<0> c7; B<A<0>, &C::c7> d7; // { dg-error "could not convert template argument" }
A<0> c8; B<A<0>, &C::c8> d8; // { dg-error "could not convert template argument" }
A<0> c9; B<A<0>, &C::c9> d9; // { dg-error "could not convert template argument" }
A<0> ca; B<A<0>, &C::ca> da; // { dg-error "could not convert template argument" }
A<0> cb; B<A<0>, &C::cb> db; // { dg-error "could not convert template argument" }
};
C<int> e;