-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Description
| Bugzilla Link | 10108 |
| Resolution | FIXED |
| Resolved on | Jun 16, 2011 12:08 |
| Version | 2.9 |
| OS | MacOS X |
| Reporter | LLVM Bugzilla Contributor |
| CC | @DougGregor |
Extended Description
GCC supports reference types for properties in Objective-C++ mode. This is not supported by clang even when using -std=gnu++0x.
Example:
% cat main.mm
#import <Foundation/Foundation.h>
@interface Test : NSObject { int i; }
@property (readonly) int const& i;
@end
@implementation Test
@synthesize i;
@end
int main (int argc, char const* argv[]) { return 0; }
----------8<----------
% clang++ -std=gnu++0x -lobjc -framework Foundation main.mm
main.mm:4:1: error: property of reference type is not supported
@property (readonly) int const& i;
^
main.mm:8:13: error: property implementation must have its declaration in interface 'Test'
@synthesize i;
^
2 errors generated.
----------8<----------
Using references is required when wrapping non-POD types in an Objective-C class.