Skip to main content
gamedev.net
🔒 Locked

Compiler bug?

Started by quant Mar 10, 2004 at 6:32 AM 6 replies 300+ views
Original Post
quant
quant
Is this code valid? Its giving me some INTERNAL COMPILER ERROR''s in vc++2003.net, i cant see a problem with it.
namespace testnamespace
{
	template<typename T,  int size>
	class trait{};

	template<typename T,  int size,  class elem = trait<T, size> >
	class something
	{};

	template<int size, typename T>
	something<T, size> test(T num)
	{
		something<T, size> instance;
		return instance;
	}	
}

int main()
{
	testnamespace::test<4, float>(1.f);
}
How can i fix it? thanks.
-keyboard
quant
quant
works fine in mingw3.2 too..
-keyboard
DrPizza
DrPizza
The code appears fine. If it's ICEing it's the compiler that's at fault.

Well, an ICE is always the compiler's fault, but if the code is bad then an ICE is probably a legitimate response.


[edited by - DrPizza on March 10, 2004 8:53:54 AM]
char a[99999],*p=a;int main(int c,char**V){char*v=c>0?1[V]:(char*)V;if(c>=0)for(;*v&&93!=*v;){62==*v&&++p||60==*v&&--p||43==*v&&++*p||45==*v&&--*p||44==*v&&(*p=getchar())||46==*v&&putchar(*p)||91==*v&&(*p&&main(0,(char**)(--v+2))||(v=(char*)main(-1,(char**)++v)-1));++v;}else for(c=1;c;c+=(91==*v)-(93==*v),++v);return(int)v;} /*** drpizza@battleaxe.net ***/
quant
quant
It works fine if i remove the namespace, which is strange, changing the order of the template parameters of the test function also seems to fix the problem.

[edited by - quant on March 10, 2004 9:14:49 AM]
-keyboard
quant
quant
quote:
Original post by petewood
clean and rebuild?


Doesn''t make the error go away
-keyboard
lemurion
lemurion
Don''t know if it will fix the problem, but I already had problem with VC6 always doing internal compiler error and the thing i needed to do is rebooting my computer and then the problem disapeared

hope that helps
Matt
Matt

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.