This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
typename bug, gcc hangs (Internal compiler error)
- To: gcc-bugs at gcc dot gnu dot org
- Subject: typename bug, gcc hangs (Internal compiler error)
- From: Thomas Fjæstad Hagelien <Thomas dot Hagelien at matek dot sintef dot no>
- Date: Thu, 15 Jun 2000 12:57:56 +0200
g++: Internal compiler error
Gcc-version: gcc version 2.95.2 19991024 (release)
uname -a : CYGWIN_NT-4.0 MTPC386 1.1.0(0.16/3/2) 1999-12-26
00:17:43 i686 unknown
Compiler options: g++ -Wall -o genfunc genfunc.cpp
source:
----------------------------------------------
// Generic function test
template<class T> T create(T val)
{
typename T::Y; // Should produce same error as
Y instance(val); // typename T::Y instance(val); ???
return instance;
}
int main()
{
create<int>(2);
return 0;
}
----------------------------------------------
This code should produce errors, but ends up in an infinite loop.
Breaking this loop (^C) gives the following message:
g++: Internal compiler error in `execute', at ../../gcc/gcc.c:2577
Please submit a full bug report.
See <URL:http://www.gnu.org/software/gcc/faq.html#bugreport> for
instructions.
Sincerely
Thomas Fjæstad Hagelien