This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Common V3 coding bug
- To: Mark Mitchell <mark at codesourcery dot com>
- Subject: Re: Common V3 coding bug
- From: Jason Merrill <jason_merrill at redhat dot com>
- Date: 18 Jul 2001 12:28:32 +0100
- Cc: libstdc++ at gcc dot gnu dot org
- References: <74320000.995435967@warlock.codesourcery.com>
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