[LLVMbugs] [Bug 7936] New: conversion to objc pointer failed in comparaison.

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Aug 19 04:31:09 PDT 2010


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

           Summary: conversion to objc pointer failed in comparaison.
           Product: clang
           Version: trunk
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: devlists at shadowlab.org
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com


Created an attachment (id=5384)
 --> (http://llvm.org/bugs/attachment.cgi?id=5384)
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.

-- 
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