Bug 142418 - G++ internal error in regenerate_decl_from_template
G++ internal error in regenerate_decl_from_template
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: gcc3 (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Depends On:
  Show dependency treegraph
Reported: 2004-12-09 12:19 EST by Fedor Pikus
Modified: 2007-11-30 17:07 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-05-18 09:42:36 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
G++ preprocessed output (886 bytes, text/plain)
2004-12-09 12:21 EST, Fedor Pikus
no flags Details

  None (edit)
Description Fedor Pikus 2004-12-09 12:19:27 EST
G++ from RHEL3u2 (gcc version 3.2.3 20030502 (Red Hat Linux 3.2.3-34))
fails to compile this program:
template <typename T> class A;
int foo( const A<int>& a );

template <typename T> class A
    friend T foo( const A& a ) { return a.x; }
    T x;

int main()
    A<int> a;
    int i = foo( a ); 
Error message is:
gccbug.C: In instantiation of `int foo(const A<int>&)':
gccbug.C:14:   instantiated from here
gccbug.C:7: Internal compiler error in regenerate_decl_from_template, at 
Please submit a full bug report,
with preprocessed source if appropriate.
Comment 1 Fedor Pikus 2004-12-09 12:21:05 EST
Created attachment 108238 [details]
G++ preprocessed output
Comment 2 Jakub Jelinek 2004-12-29 12:43:07 EST
Seems to be fixed by http://gcc.gnu.org/ml/gcc-patches/2003-07/msg01453.html
in GCC 3.3 and backported version of this patch fixes it on gcc-3_2-rhl8-branch
as well. Will add to RHEL3 U5 candidate patches after more testing.
Comment 4 Jakub Jelinek 2005-01-04 12:57:21 EST
Fix for this has been added to gcc-3.2.3-50, for the time being available from:
Comment 5 Tim Powers 2005-05-18 09:42:36 EDT
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.