This is the mail archive of the gcc-bugs@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]
Other format: [Raw text]

Re: c++/6229: gcc 3.1 namespace lookup seems to fail


> This is not a bug.  The operator called is the one that takes a bool.
This
> happens because the unqualified lookup only finds the second one you
> define, and argument-dependent lookup looks in std and ns.  This worked in
> 2.95.3 because the standard library was in the global namespace, rather
> than std.

Thanks a lot for your detailed explanation.

I did not realize that the compiler stops looking for operator<< in
unqualified lookup after finding one in the innermost namespace.

A final question remains: Why is the operator<< that takes a bool considered
the best match for my function pointer (why not, for example, the one taking
an int)?


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