internal compiler error: in build_call, at cp/call.c:323 Can't narrow it down - happens in five different places in our codebase.
Created attachment 10455 [details] Preprocessed file that causes error
Just tested; it's live in 4.0-20051208.
Reducing.
Reduced to: class OFX_PropertySuiteV1 { static int propGetDouble (); }; template<int dimension, class T, int (*PROPGET)() > struct OFX_AnimatedNumberParam { virtual int paramSetValueAtTime() { return PROPGET(); } }; void f() { new OFX_AnimatedNumberParam<2,double,OFX_PropertySuiteV1::propGetDouble>(); }
This is a regression from 4.0.2.
Mark, this appeared with your patch http://gcc.gnu.org/ml/gcc-cvs/2005-10/msg00056.html Looks like a latent bug, though. BTW, the code compiles with a function reference instead of a function pointer as template parameter.
*** Bug 25383 has been marked as a duplicate of this bug. ***
Disagree with known to work 4.0.2 - original report was from 4.0.2.
Must be fixed: P1.
Shorter testcase: ===================================== struct A { static void foo(); }; template<void (*fp)()> struct B { B() { fp(); } }; B<A::foo> b; =====================================
Subject: Bug 25364 Author: mmitchel Date: Thu Dec 22 19:59:00 2005 New Revision: 108971 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=108971 Log: PR c++/25364 * semantics.c (finish_qualified_id_expr): Call mark_used. PR c++/25364 * g++.dg/template/call4.C: New test. Added: branches/gcc-4_1-branch/gcc/testsuite/g++.dg/template/call4.C Modified: branches/gcc-4_1-branch/gcc/cp/ChangeLog branches/gcc-4_1-branch/gcc/cp/semantics.c branches/gcc-4_1-branch/gcc/testsuite/ChangeLog
Subject: Bug 25364 Author: mmitchel Date: Thu Dec 22 20:02:21 2005 New Revision: 108972 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=108972 Log: PR c++/25364 * semantics.c (finish_qualified_id_expr): Call mark_used. (finish_id_expression): Likewise. PR c++/25364 * g++.dg/template/call4.C: New test. Added: branches/gcc-4_0-branch/gcc/testsuite/g++.dg/template/call4.C Modified: branches/gcc-4_0-branch/gcc/cp/ChangeLog branches/gcc-4_0-branch/gcc/cp/semantics.c branches/gcc-4_0-branch/gcc/testsuite/ChangeLog
Subject: Bug 25364 Author: mmitchel Date: Thu Dec 22 20:08:39 2005 New Revision: 108973 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=108973 Log: PR c++/25364 * typeck.c (build_unary_op): Pass DECLs not names to build_offset_refs. * init.c (build_offset_ref): Do not do name lookup. Do not call mark_used. * call.c (build_call): Simplify and tidy. * semantics.c (finish_qualified_id_expr): Call mark_used. PR c++/25364 * g++.dg/template/call4.C: New test. Added: trunk/gcc/testsuite/g++.dg/template/call4.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/call.c trunk/gcc/cp/init.c trunk/gcc/cp/semantics.c trunk/gcc/cp/typeck.c trunk/gcc/testsuite/ChangeLog
Fixed in 4.0.3.
*** Bug 25659 has been marked as a duplicate of this bug. ***
(In reply to comment #8) > Disagree with known to work 4.0.2 - original report was from 4.0.2. I actually disagree with saying the compiler you are using is a 4.0.2 compiler. It is a 4.0.3 compiler from the date you gave in comment #3.
It's live in the 4.0.2 installed by a Fedora Core 4 yum update right now (4.0.2 20051125 (Red Hat 4.0.2-8)).
> It's live in the 4.0.2 installed by a Fedora Core 4 yum update right now > (4.0.2 20051125 (Red Hat 4.0.2-8)). This is not the official FSF 4.0.2 release. Redhat's 4.0.2-8 version contains some patches from the 4.0.3 release. Even their gcc.info file says so: This manual documents how to use the GNU compilers, as well as their features and incompatibilities, and how to report bugs. It corresponds to GCC version 4.0.3. The internals of the GNU compilers, including ^^^^^^^
Verified fixed (against original source problem) in 4.0.3 20060105