This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/6229: gcc 3.1 namespace lookup seems to fail
- From: "Peter Klotz" <peter dot klotz at aon dot at>
- To: "Jason Merrill" <jason at redhat dot com>
- Cc: <gcc-bugs at gcc dot gnu dot org>
- Date: Tue, 9 Apr 2002 23:42:35 +0200
- Subject: Re: c++/6229: gcc 3.1 namespace lookup seems to fail
- References: <20020409173640.2EAC5F79F5@prospero.cambridge.redhat.com>
> 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)?