This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/11870] Namespace lookup failure. Inside a function of a class in a namespace, a >> b does not look ::operator>>(a, b) if an operator>> of the same namespace is declared as friend.
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 11 Aug 2003 21:03:19 -0000
- Subject: [Bug c++/11870] Namespace lookup failure. Inside a function of a class in a namespace, a >> b does not look ::operator>>(a, b) if an operator>> of the same namespace is declared as friend.
- References: <20030809224347.11870.lachaume@mpifr-bonn.mpg.de>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11870
------- Additional Comments From bangerth at dealii dot org 2003-08-11 21:03 -------
My understanding is that name lookup works the in the following way: we
look into the present namespace and the namespaces of the arguments of
the arguments, and apply the names found there to overload resolution.
In your case, only the operator in namespace M is found at this stage,
and argument conversion fails.
Only if no name is found in the namespaces listed above, we look into
surrounding namespaces, where we would find a suitable match. But that
is hidden by the match found previously.
W.