egcs bug

Rafal Dabrowa rafal@waw1.softsystem.com.pl
Thu May 6 02:31:00 GMT 1999


Hello !!

I found a bug in egcs (egcs 1.1.2) in g++ compiler (egcs-2.91.66).
There is a code causing bug:
----------------------------------------------------------------------------
template <class T>
void doit( T VarVar )
{
	struct { T num; unsigned char str[sizeof(VarVar)]; } z;
}

int main()
{
	doit(3);
	return 0;
}
----------------------------------------------------------------------------
And there is compilation output:
    g++ -c test1.cpp
test1.cpp: In instantiation of `doit<int>(int)::doit<int>(int)::._0<int>':
test1.cpp:4:   instantiated from `doit<int>(int)'
test1.cpp:9:   instantiated from here
test1.cpp:4: `VarVar' was not declared in this scope

Rafal



More information about the Gcc-bugs mailing list