This is the mail archive of the gcc@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: Namespace Lookup


> There are no namespaces involved in this example, nor in your other
> example, so the Koenig rules do not kick in.  This are resolved using
> the normal unqualified name lookup rules as far as I understand the
> standard (but I only have the Dec'96 draft so things may have changed).

I'm afraid I can't agree. First, Koenig lookup always applies to
function calls where the postfix expression is an unqualified name.
It is not invoked *only* if normal lookup finds a member
function. This was not the case in the example, so Koenig lookup
computes the associated namespaces. Of course, it only gets the global
namespace, so there is no change here.

OTOH, I understand that the 'final draft' not only defines associated
namespaces, but also associated classes (and the associated namespaces
are the namespaces of the associated classes, plus a few more). It then
goes on saying that the name is looked up in the associated namespaces
and classes.

This is how I constructed my examples: I'm not sure what the lookup in
the associated classes is supposed to do. For one thing, it is
certainly meant to include all friends into Koenig lookup, even if they
are not in the associated namespaces. I'm not sure what else would
be found.

Regards,
Martin


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