Common V3 coding bug
Jason Merrill
jason_merrill@redhat.com
Wed Jul 18 04:30:00 GMT 2001
We really need to emit a warning for this case, like the existing warning
about typename. My strong preference would be to accept the code with an
unconditional pedwarn; there's a LOT of code that depends on this behavior.
i.e. if we see an unqualified id, we look it up normally and in the
pseudo-scope of its uninstantiated bases as well. If both find it, use the
normal result and warn. If only the second finds it, use that result and
pedwarn.
Another way to deal with this would be to remember all the unqualified
lookups in a member function of a class template, and at instantiation time
see if looking it up in the full class context produces a different result.
This would have the benefit of catching more obscure variants of this
mistake, but would not help existing code to compile; your testcase would
just get an uninformative error.
Or we could do both, only trying the pseudo-lookup if normal lookup fails.
Jason
More information about the Libstdc++
mailing list