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 â⬘__typeof__ (((T() > U()) ? T() : U())) MaX(const T&, const U&) [with T = int, U = int]â⬙: 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:
That's a well known upstream bug. No point to track it here separately.