This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


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

Re: Common V3 coding bug


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


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