From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.1) Gecko/20020830 Description of problem: attached code compiled well under gcc-2.9xx and gives errors on gcc-3 Version-Release number of selected component (if applicable): How reproducible: Always Steps to Reproduce: 1.g++ -c bug.cpp 2. 3. Actual Results: g++ -c bug.cpp bug.cpp: In function `int main(int, char**)': bug.cpp:36: Internal compiler error in resolve_offset_ref, at cp/init.c:1886 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://bugzilla.redhat.com/bugzilla/> for instructions. Expected Results: g++ -c bug.cpp Additional info: --- bug.cpp ---- class ClassA { public: ClassA(){} virtual ~ClassA(){}; double memberFunction( void ){ return 1.0; } }; typedef double (ClassA::*constraint_function)(void ); class ClassB { ClassA* classA; constraint_function function; public: ClassB (ClassA* _classA, constraint_function f): classA(_classA), function(f){}; virtual ~ClassB (){}; double doSomething(){ return (((*classA).*function)()); } }; int main(int argc, char **argv){ ClassB classB(&(ClassA::memberFunction)); classB.doSomething(); }
Created attachment 85545 [details] cpp test code
This is not valid code, and newer GCCs (such as gcc-3.2.2-{1,2} from rawhide no longer ICE on it, but issue diagnostics).