[LLVMbugs] [Bug 10309] New: Can't override a virtual function and return a more specific ObjC type
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Fri Jul 8 06:46:27 PDT 2011
http://llvm.org/bugs/show_bug.cgi?id=10309
Summary: Can't override a virtual function and return a more
specific ObjC type
Product: new-bugs
Version: unspecified
Platform: Macintosh
OS/Version: MacOS X
Status: NEW
Severity: normal
Priority: P
Component: new bugs
AssignedTo: unassignedbugs at nondot.org
ReportedBy: alee at mimsoftware.com
CC: llvmbugs at cs.uiuc.edu
#import <Foundation/Foundation.h>
@interface Test : NSObject
@end
@interface TestX : Test
@end
class Top {
virtual Test* getTest();
};
class Bottom: public Top {
virtual TestX* getTest(); //Error generated on this line
};
LLVM outputs the following error: virtual function 'getTest' has a different
return type ('TestX *') than the function it overrides (which has return type
'Test *')
TestX is a subclass of Test in this scenario so there should be no error here
(legitimately narrowing the return type).
Using the Apple LLVM compiler 3.0 in Xcode 4.2 Build 4D58. It's worth noting
that this same code compiles cleanly under GCC 4.2.
--
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