[forwarded from http://bugs.debian.org/284777] seen with 3.4 branch 20041215 and CVS HEAD, works with 3.3 CVS branch $ g++-3.4 bug-284777.cc bug-284777.cc: In member function `void Dummy<T>::tester()': bug-284777.cc:13: internal compiler error: in uses_template_parms, at cp/pt.c:4860 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions. template<typename T> struct Dummy { void evil() { this->template tester<true>(); } template<bool B> void tester() { // evil should actually be a bool bar<evil>()(); } template<bool B> struct bar { void operator()() { } }; }; int main() {}
: Search converges between 2003-07-15-trunk (#295) and 2003-07-16-trunk (#296).
Looking at it.
This should be ice-on-invalid-code. The code: bar<evil>()(); must be replaced with: bar<&Dummy::evil>()(); because 'evil' alone is not a valid pointer-to-member function. GCC compiles file with the corrected code.
Well, it's not really a regression, since GCC accepted the code before 3.4.0.
Fixed for gcc 4.0.0.
So closing now.
The problem reappeared today :-(
(In reply to comment #4) > Well, it's not really a regression, since GCC accepted the code before 3.4.0. Even though we acceted it before 3.4.0, this is a regression in that we should not change anything to an ICE.
Moving to 4.0.2 pre Mark.
Subject: Bug 19004 CVSROOT: /cvs/gcc Module name: gcc Changes by: mmitchel@gcc.gnu.org 2005-08-26 19:35:13 Modified files: gcc/cp : ChangeLog pt.c gcc/testsuite : ChangeLog Added files: gcc/testsuite/g++.dg/template: nontype13.C Log message: 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. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4860&r2=1.4861 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/pt.c.diff?cvsroot=gcc&r1=1.1025&r2=1.1026 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.5965&r2=1.5966 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/nontype13.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
Fixed in GCC 4.0.2.
Subject: Bug 19004 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-4_0-branch Changes by: mmitchel@gcc.gnu.org 2005-08-26 19:37:52 Modified files: gcc/testsuite : ChangeLog gcc/cp : ChangeLog cp-tree.h init.c pt.c typeck.c gcc/testsuite/g++.dg/expr: anew1.C anew2.C anew3.C Added files: gcc/testsuite/g++.dg/init: new14.C gcc/testsuite/g++.dg/template: nontype13.C Log message: 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. (build_aggr_init): Likewise. (build_new_1): Do not call build_default_init for array types. (build_vec_init): Add explicit_default_init_p parameter. Perform default initialization of vector elements when set. * typeck.c (build_modify_expr): Adjust call to build_vec_init. 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. * g++.dg/expr/anew2.C: Likewise. * g++.dg/expr/anew3.C: Likewise. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.5084.2.351&r2=1.5084.2.352 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.4648.2.83&r2=1.4648.2.84 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/cp-tree.h.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.1106.2.11&r2=1.1106.2.12 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/init.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.412.2.6&r2=1.412.2.7 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/pt.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.978.2.18&r2=1.978.2.19 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/typeck.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.616.2.14&r2=1.616.2.15 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/init/new14.C.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=NONE&r2=1.1.2.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/expr/anew1.C.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.3&r2=1.3.42.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/expr/anew2.C.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.3&r2=1.3.42.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/expr/anew3.C.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.3&r2=1.3.42.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/nontype13.C.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=NONE&r2=1.1.2.1
Taking care of the backport to the 3.4 branch.
Subject: Bug 19004 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-3_4-branch Changes by: reichelt@gcc.gnu.org 2005-09-03 19:53:01 Modified files: gcc/cp : ChangeLog pt.c gcc/testsuite : ChangeLog Added files: gcc/testsuite/g++.dg/template: nontype13.C Log message: Backport: 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. * g++.dg/template/nontype13.C: New test. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3892.2.238&r2=1.3892.2.239 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/pt.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.816.2.59&r2=1.816.2.60 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3389.2.431&r2=1.3389.2.432 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/nontype13.C.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.1.10.1
Fixed also on the 3.4 branch.