Implicit conversions of id in objc++

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Implicit conversions of id in objc++

Nico Weber-2
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

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Implicit conversions of id in objc++

John McCall

On Jun 10, 2010, at 8:45 PM, Nico Weber wrote:

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?

This is not intentional, but you should not file a bug because I have fixed it (in r105817).  Thanks for the report!

John.

_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Implicit conversions of id in objc++

Nico Weber
Thanks for fixing the problem :-)

On Fri, Jun 11, 2010 at 3:06 AM, John McCall <[hidden email]> wrote:

On Jun 10, 2010, at 8:45 PM, Nico Weber wrote:

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?

This is not intentional, but you should not file a bug because I have fixed it (in r105817).  Thanks for the report!

John.


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|

Re: Implicit conversions of id in objc++

Nico Weber
In reply to this post by John McCall
Thanks for fixing the problem :-)

On Fri, Jun 11, 2010 at 3:06 AM, John McCall <[hidden email]> wrote:

On Jun 10, 2010, at 8:45 PM, Nico Weber wrote:

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?

This is not intentional, but you should not file a bug because I have fixed it (in r105817).  Thanks for the report!

John.


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev