class name used inside class ?

David C Binderman dcb@pncl.co.uk
Sun Nov 15 09:37:00 GMT 1998


Hello there,

I suspect that the following C++ code is not permitted.

struct S {
	union {
		int S; 	// surely not permitted ?
	};
};

void
f( S * ps)
{
	int i = ps->S;
};

But egcs-981109 on Linux/Alpha 5.6, even with flags -ansi -pedantic -Wall,
compiles the code no problem.

Regards

David C Binderman MSc BSc	+44 1293 534847		dcb@pncl.co.uk




More information about the Gcc-bugs mailing list