[LLVMbugs] [Bug 7205] New: Obj-C++ methods with arguments that reference C++ objects fail under Clang

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Sat May 22 16:41:24 PDT 2010


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

           Summary: Obj-C++ methods with arguments that reference C++
                    objects fail under Clang
           Product: clang
           Version: 2.7
          Platform: Macintosh
        OS/Version: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: bradmarston at mac.com
                CC: llvmbugs at cs.uiuc.edu, dgregor at apple.com


Of the following two Obj-C methods, only the first compiles under Clang
(llvm-2.7) but both compile properly under gcc4.2-llvm:

    [objcObject methodByPointer:cppObject];

    [objcObject methodByReference:*cppObject];

where the Obj-C++ methods are declared as:

- (void)methodByPointer:(cppClass *)object;
- (void)methodByReference:(cppClass &)object;


The error returned by Clang for the second method is:

/Users/jbm/Desktop/Obj-C++/Test/Test.mm:17:0
/Users/jbm/Desktop/Obj-C++/Test/Test.mm:17:35: error: incompatible type sending
'class cppClass', expected 'class cppClass &'


I have attached an Xcode project that illustrates this with minimal lines of
code.  When compiled under gcc4.2 both methods correctly access the cppObject
to return the number 42.  

Question:  Is this an ambiguity in the specification of Obj-C++?

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