Bug (?) in namespaces and overloading resolution

Martin v. Loewis loewis@informatik.hu-berlin.de
Mon Jun 22 13:18:00 GMT 1998


> The following code does not compile on 19980604, I believe it should.
> It works if the defintion of struct X is moved into namespace B.

Can you be a bit more specific why you think this should work? It
seems you are aiming at argument-dependent lookup. Given the arguments
cerr of type std::ostream (in theory) and t of type A::X, the
associated namespaces of this call are std and A. Neither one defines
a suitable operator; it doesn't help that one is defined in B.

So AFAICT, the diagnosis is right.

Martin



More information about the Gcc-bugs mailing list