Bug 175528 - Bad: internal compiler error when using typeof
Bad: internal compiler error when using typeof
Product: Fedora
Classification: Fedora
Component: gcc4 (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Depends On:
  Show dependency treegraph
Reported: 2005-12-12 07:05 EST by Li Jie
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-12-12 07:30:51 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

External Trackers
Tracker ID Priority Status Summary Last Updated
GNU Compiler Collection 13740 None None None Never

  None (edit)
Description Li Jie 2005-12-12 07:05:36 EST
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; Maxthon; Poco 0.31; .NET CLR 1.1.4322; .NET CLR 2.0.50215)

Description of problem:
I write this code:

template <class T, class U> 
typeof(T() > U() ? T() : U()) MaX (const T& t, const U& u) 
return t > u ? t : u; 

int main ()
    int a = MaX(3, (short)5);
    double b = MaX(5, 3.5);
    return 0;

It has some errors when compiling:

test.cpp: In function &acirc;€&#732;__typeof__ (((T() > U()) ? T() : U())) MaX(const T&, const U&) [with T = int, U = int]&acirc;€&#8482;: 
test.cpp:8: internal compiler error: in write_type, at cp/mangle.c:1646 
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/ccdZk5dN.out file, please attach this to your bugreport. 

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. save the code to "test.cpp"
2. run "g++ -o test test.cpp

Additional info:
Comment 1 Jakub Jelinek 2005-12-12 07:30:51 EST
That's a well known upstream bug.  No point to track it here separately.

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