[LLVMbugs] [Bug 10835] New: Obj-C++ instance method that returns a C++ derived class causes crash

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Sep 2 06:40:05 PDT 2011


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

           Summary: Obj-C++ instance method that returns a C++ derived
                    class causes crash
           Product: clang
           Version: unspecified
          Platform: Macintosh
        OS/Version: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: bradmarston at mac.com
                CC: llvmbugs at cs.uiuc.edu


Created an attachment (id=7195)
 --> (http://llvm.org/bugs/attachment.cgi?id=7195)
Xcode 4 project that demonstrates the problem with minimal code

An Objective-C++ instance method that returns a derived C++ object causes a
crash when the code is compiled with clang but works under LLVM GCC.  The
debugger says that a pointer being freed wasn't allocated.   The problem occurs
under both OS X 10.6 and 10.7, and with versions of clang that support
Objective-C++.

The attached Xcode project illustrates the problem with minimal code.  Note
that the function "D dummy2()" is able to properly return a derived C++ object
of class D, but the Obj-C instance method "- (D) dummy" fails (but only when
compiled with clang).  Obj-C instance properly return C++ objects of the base
class (B).

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