Bug 39156 - Internal compiler error on (invalid) use of undefined type in template function
Summary: Internal compiler error on (invalid) use of undefined type in template function
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.0.1
: P3 normal
Target Milestone: 4.1.2
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-11 21:10 UTC by Craig Schroeder
Modified: 2009-02-11 21:12 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Craig Schroeder 2009-02-11 21:10:02 UTC
This line of code causes an internal compiler when compiled with g++ without options:

class B;template<class T> void foo(B& x) {x(0);}

Compiler:

Using built-in specs.
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-4.0.1/configure --prefix=/usr/local/compilers/gcc-4.0.1-x86_64-x86_64 --enable-languages=c,c++ --enable-bootstrap
Thread model: posix
gcc version 4.0.1

Compiling with this newer version yields a meaningful diagnostic instead of an internal error:

Using built-in specs.
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-libgcj-multifile --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --enable-plugin --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --with-cpu=generic --host=x86_64-redhat-linux
Thread model: posix
gcc version 4.1.2 20070626 (Red Hat 4.1.2-14)
Comment 1 Andrew Pinski 2009-02-11 21:12:41 UTC
You reported this against 4.0.1 and 4.0.x and 4.1.x are no longer being
supported (meaning no more 4.0.x or 4.1.x release).  Since it has been fixed in
4.1.2, I am closing this as fixed.