Bug 156185 - Internal compiler error in c_expand_expr, at c-common.c:3830
Internal compiler error in c_expand_expr, at c-common.c:3830
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: gcc (Show other bugs)
ia64 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Depends On:
Blocks: 161600 168424
  Show dependency treegraph
Reported: 2005-04-28 05:44 EDT by Karljohan Lundin
Modified: 2007-11-30 17:07 EST (History)
2 users (show)

See Also:
Fixed In Version: RHBA-2006-0147
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-03-15 10:28:02 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Code that produce internal error (215 bytes, text/plain)
2005-04-28 05:46 EDT, Karljohan Lundin
no flags Details
Working code (218 bytes, text/plain)
2005-04-28 05:48 EDT, Karljohan Lundin
no flags Details
Preprocessed source (879 bytes, text/plain)
2005-04-28 05:50 EDT, Karljohan Lundin
no flags Details
Backport of patch that fixes the bug (1.67 KB, patch)
2005-09-26 16:17 EDT, Alexandre Oliva
no flags Details | Diff

  None (edit)
Description Karljohan Lundin 2005-04-28 05:44:55 EDT
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):

How reproducible:

Steps to Reproduce:
1. Compile the enclosed code

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,
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
Comment 1 Karljohan Lundin 2005-04-28 05:46:27 EDT
Created attachment 113761 [details]
Code that produce internal error
Comment 2 Karljohan Lundin 2005-04-28 05:48:08 EDT
Created attachment 113762 [details]
Working code

In this file a static reference to the member function is made, which compiles
without error.
Comment 3 Karljohan Lundin 2005-04-28 05:50:28 EDT
Created attachment 113763 [details]
Preprocessed source
Comment 4 Alexandre Oliva 2005-09-26 16:17:52 EDT
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
Comment 10 Red Hat Bugzilla 2006-03-15 10:28:02 EST
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.


Note You need to log in before you can comment on or make changes to this bug.