From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.7) Gecko/20050414 Firefox/1.0.3 Description of problem: When compiling a piece of code that use a static construction with a static template member function without referencing the class to which this function is a member, the compiler produce an internal error. Version-Release number of selected component (if applicable): gcc-3.2.3-47 How reproducible: Always Steps to Reproduce: 1. Compile the enclosed code 2. 3. Actual Results: The enclosed code does not compile, but generates an internal error from the compiler. Expected Results: Either the compiler should (on line 17) accept the newInstance function as the function in class C or it should complain about the function not being declared in the current (global) scope. Additional info: The code compiles fine on my i686 linux computer with gcc (GCC) 3.3.5 on Debian unstable. Error message: [user@host program]$ make bugtest g++ bugtest.cpp -o bugtest bugtest.cpp: In function `void __static_initialization_and_destruction_0(int, int)': bugtest.cpp:17: Internal compiler error in c_expand_expr, at c-common.c:3830 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://bugzilla.redhat.com/bugzilla/> for instructions. Preprocessed source stored into /tmp/ccU3MlcH.out file, please attach this to your bugreport. make: *** [bugtest] Error 1
Created attachment 113761 [details] Code that produce internal error
Created attachment 113762 [details] Working code In this file a static reference to the member function is made, which compiles without error.
Created attachment 113763 [details] Preprocessed source
Created attachment 119274 [details] Backport of patch that fixes the bug This patch enables us to correctly restore the bindings of overloaded member functions when bringing a class bindings back into scope for unqualified lookup.
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on the solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2006-0147.html