[LLVMbugs] [Bug 7936] conversion to objc pointer failed in comparison.

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Aug 20 17:11:29 PDT 2010


http://llvm.org/bugs/show_bug.cgi?id=7936

Fariborz Jahanian <fjahanian at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #2 from Fariborz Jahanian <fjahanian at apple.com> 2010-08-20 19:11:28 CDT ---
(In reply to comment #1)
> (In reply to comment #0)
> > Created an attachment (id=5384)
 --> (http://llvm.org/bugs/attachment.cgi?id=5384) [details] [details]
> > patch to add a test case to clang test suite for this issue.
> > 
> > There is a case where implicit conversion to an objc object type failed.
> > 
> > ----- Simple Test Case ------
> > 
> > class Wrapper {
> > public:
> >   operator id() const { return (id)_value; }
> >   bool Compare(id obj) { return *this == obj; }
> > 
> > private:
> >   long _value;
> > };
> > 
> > ----- ----- ----- ----- ----- 
> > g++ don't have any problem to compile this code, but when compiling with clang,
> > we get this:
> > 
> > clang++ -fsyntax-only Test.mm
> > Test.mm:5:39: error: invalid operands to binary expression ('Wrapper' and 'id')
> >   bool Compare(id obj) { return *this == obj; }
> >                                 ~~~~~ ^  ~~~
> > 1 error generated.
> 
> clang bug. If conversion to "void *"  works, so should conversion to 'id'. I
> will take a look.

Fixed in r111699

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list