On Apr 14, 2011, at 6:02 PM, Nico Weber wrote:

> Hi Doug,
> 
> this change breaks the following program, which builds fine with gcc
> and used to build fine with clang:
> 
> #import <AppKit/AppKit.h>
> 
> #include <iostream>
> using namespace std;
> 
> template <typename T>
> inline void g(std::ostream* os, const T& val) {
>  *os << val;
> }
> 
> std::ostream& operator<<(std::ostream& out, const NSObject* obj) {
>  return out << "asdf";
> }
> 
> void f(ostream& out, const NSEvent* e) {
>  g(&out, e);
> }
> 
> 
> Is this intended?


It's intended that ADL is finding the later operator<<. However, it looks like 
overloading isn't preferring the conversion-to-superclass over the 
conversion-to-void*.

        - Doug
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to