[cfe-dev] Implicit conversion of id in objc++ mode

Nico Weber thakis at chromium.org
Thu Jun 10 20:46:37 PDT 2010


Hi,

cat > out.mm << EOF
class A {
 public:
   void operator<<(bool n);
   void operator<<(const void* p);
};

int f() {
  id b;
  A a;
  a << b;
}
EOF

g++ -c out.mm  #works
clang++ -c out.mm
test.mm:13:5: error: use of overloaded operator '<<' is ambiguous
  a << b;
  ~ ^  ~
test.mm:6:9: note: candidate function
   void operator<<(bool n);
        ^
test.mm:7:9: note: candidate function
   void operator<<(const void* p);
        ^
1 error generated.

Is this intentional? Should I file a bug?

Thanks,
Nico
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20100610/4de2ae8b/attachment.html>


More information about the cfe-dev mailing list