From: Jakub Jelinek Date: Mon, 8 Oct 2012 19:39:56 +0000 (+0200) Subject: re PR c++/54858 (ICE in cp_tree_equal) X-Git-Tag: misc/gccgo-go1_1_2~320 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9b2770f22cfddf5a0ab54659ce696071b0857444;p=thirdparty%2Fgcc.git 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: r192220 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 7f5d45f90a2b..f4e7e6a18468 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2012-10-08 Jakub Jelinek + + PR c++/54858 + * tree.c (cp_tree_equal): Handle FIELD_DECL. + 2012-10-08 Jason Merrill Allow dynamic initialization of thread_locals. diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index e1af378645a4..14ca5a932c52 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -2559,6 +2559,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: diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 1345f72f6f73..a2f300d8a85a 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2012-10-08 Jakub Jelinek + + PR c++/54858 + * g++.dg/template/pr54858.C: New test. + 2012-10-08 Dehao Chen * g++.dg/predict-loop-exit-1.C: New. diff --git a/gcc/testsuite/g++.dg/template/pr54858.C b/gcc/testsuite/g++.dg/template/pr54858.C new file mode 100644 index 000000000000..51610ad689a2 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/pr54858.C @@ -0,0 +1,21 @@ +// PR c++/54858 +// { dg-do compile } + +template struct A {}; +template struct B {}; +template struct C +{ + A<0> c0; B, &C::c0> d0; // { dg-error "could not convert template argument" } + A<0> c1; B, &C::c1> d1; // { dg-error "could not convert template argument" } + A<0> c2; B, &C::c2> d2; // { dg-error "could not convert template argument" } + A<0> c3; B, &C::c3> d3; // { dg-error "could not convert template argument" } + A<0> c4; B, &C::c4> d4; // { dg-error "could not convert template argument" } + A<0> c5; B, &C::c5> d5; // { dg-error "could not convert template argument" } + A<0> c6; B, &C::c6> d6; // { dg-error "could not convert template argument" } + A<0> c7; B, &C::c7> d7; // { dg-error "could not convert template argument" } + A<0> c8; B, &C::c8> d8; // { dg-error "could not convert template argument" } + A<0> c9; B, &C::c9> d9; // { dg-error "could not convert template argument" } + A<0> ca; B, &C::ca> da; // { dg-error "could not convert template argument" } + A<0> cb; B, &C::cb> db; // { dg-error "could not convert template argument" } +}; +C e;