Bug 142418 - G++ internal error in regenerate_decl_from_template
Summary: G++ internal error in regenerate_decl_from_template
Alias: None
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: gcc3
Version: 3.0
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2004-12-09 17:19 UTC by Fedor Pikus
Modified: 2007-11-30 22:07 UTC (History)
0 users

Clone Of:
Last Closed: 2005-05-18 13:42:36 UTC

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

External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2005:258 normal SHIPPED_LIVE gcc bug fix update 2005-05-18 04:00:00 UTC

Description Fedor Pikus 2004-12-09 17:19:27 UTC
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 17:21:05 UTC
Created attachment 108238 [details]
G++ preprocessed output

Comment 2 Jakub Jelinek 2004-12-29 17:43:07 UTC
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 17:57:21 UTC
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 13:42:36 UTC
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.