c++/6371: bug with template functions

lodewijk_smit@yahoo.com lodewijk_smit@yahoo.com
Fri Apr 19 06:06:00 GMT 2002


>Number:         6371
>Category:       c++
>Synopsis:       g++ crashes with template function with wrong return type
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          ice-on-illegal-code
>Submitter-Id:   net
>Arrival-Date:   Fri Apr 19 00:46:02 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Lodewijk Smit
>Release:        3.0.3
>Organization:
University of Twente	
>Environment:
System: Linux loki 2.4.9-31smp #1 SMP Tue Feb 26 06:55:00 EST 2002 i686 unknown
Architecture: i686

	
host: i686-pc-linux-gnu
build: i686-pc-linux-gnu
target: i686-pc-linux-gnu
configured with: ./configure --prefix=/home/aid/smitl/linux
>Description:
The compiler crashes instead of reporting an error in the code for a template
function that returns a wrong type. See code below.
>How-To-Repeat:
Compile the following piece of code:
--------------start here-------------
template<class T>
T MaxS(T X, T Y)
{

}

T MaxS(int X ,int Y) {

}

main() {};
--------------end here---------------
>Fix:
Work around: Write correct code :-)
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the Gcc-bugs mailing list