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]

[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.


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.


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