Bug 142418

Summary: G++ internal error in regenerate_decl_from_template
Product: Red Hat Enterprise Linux 3 Reporter: Fedor Pikus <pikus>
Component: gcc3Assignee: Jakub Jelinek <jakub>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 3.0   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-05-18 13:42:36 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
G++ preprocessed output none

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
{
    public:
    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 
   cp/pt.c:9905
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:
ftp://people.redhat.com/jakub/gcc/3.2.3-50/


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.

http://rhn.redhat.com/errata/RHBA-2005-258.html