Bug 175528 - Bad: internal compiler error when using typeof
Summary: Bad: internal compiler error when using typeof
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc4
Version: 4
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2005-12-12 12:05 UTC by Li Jie
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2005-12-12 12:30:51 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
GNU Compiler Collection 13740 0 None None None Never

Description Li Jie 2005-12-12 12:05:36 UTC
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:
Always

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 12:30:51 UTC
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.