quick question
Martin von Loewis
martin@mira.isdn.cs.tu-berlin.de
Sat Aug 29 15:40:00 GMT 1998
> You notice the variable v in the template function test1() is undeclared.
I see. This is a known (to everybody else, at least) bug in gcc.
> Is there an option which I can use to force the compiler to examine all the
> codes?
For templates in C++, there are names that depend on template
parameters and names that don't. In your example, v was not a
dependent name, so it should have been bound at the time of
declaration.
g++ currently binds names at the time of instantiation, which is when
you get the error. There is no work-around for that, sorry.
Martin
More information about the Gcc
mailing list