This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
invalid C++ code w/ function template and namespace causes internal compiler error
- From: Stefan Westerfeld <stefan at space dot twc dot de>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 19 Jun 2002 20:07:19 +0200
- Subject: invalid C++ code w/ function template and namespace causes internal compiler error
/*
Hi!
The following piece of source code produces an internal compiler error
=> with gcc-2.95.4
stefan@birgrave:/usr/src/sfk/sfk$ gcc bugreport.cpp
bugreport.cpp:12: Internal compiler error.
bugreport.cpp:12: Please submit a full bug report.
bugreport.cpp:12: Internal compiler error:
bugreport.cpp:12: See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
stefan@birgrave:/usr/src/sfk/sfk$ gcc -v
Reading specs from /usr/lib/gcc-lib/i386-linux/2.95.4/specs
gcc version 2.95.4 20011002 (Debian prerelease)
=> with gcc-3.0
stefan@birgrave:/usr/src/sfk/sfk$ gcc-3.0 bugreport.cpp
bugreport.cpp:12: Internal error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
stefan@birgrave:/usr/src/sfk/sfk$ gcc-3.0 -v
Reading specs from /usr/lib/gcc-lib/i386-linux/3.0.4/specs
Configured with: ../src/configure -v --enable-languages=c,c++,java,f77,proto,objc --prefix=/usr --infodir=/share/info --mandir=/share/man --enable-shared --with-gnu-as --with-gnu-ld --with-system-zlib --enable-long-long --enable-nls --without-included-gettext --disable-checking --enable-threads=posix --enable-java-gc=boehm --with-cpp-install-dir=bin --enable-objc-gc i386-linux
Thread model: posix
gcc version 3.0.4
*/
namespace std {
class A {
};
};
template <class Type>
char *getTypeName (Type& t)
{
return "*unknown*";
}
template <class std::A>
char *getTypeName (std::A& s)
{
return "std::A";
}