This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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";
}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]