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]

Re: Parse error with scope-resolution operator


"Richard B. Kreckel" <kreckel@ginac.de> writes:

[...]

| int main(void) {
|     // (1<::foo()) produces parse error, but should be ok, since we are
|     // living in the global namespace.  (1>::foo()) works, however.

This is a latent bug in the gcc-2.96 series parser. I came across it a
while ago but forgot to pay attentin to it. The crux of the problem
lies in that, somehow the lexer thinks '<:' is a token.

Obviously the same problem appears in

	struct X {};

	template<typenanme T> struct Y {};

	int main() 
	{
		Y<::X> z;
	}

-- Gaby
CodeSourcery, LLC                             http://www.codesourcery.com

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