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]

typename bug, gcc hangs (Internal compiler error)


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

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