summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-07-12 04:30:16 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-07-12 04:30:16 +0000
commit52bfc2b66835525fbfa23f9ab224f0eb33f50892 (patch)
tree50e12bc6cbaf027b47f6af14bcf571d860add473 /clang/lib/CodeGen/CodeGenModule.cpp
parentb1907b2ab035fbb422eeeb6c1100b03939f14f24 (diff)
downloadbcm5719-llvm-52bfc2b66835525fbfa23f9ab224f0eb33f50892.tar.gz
bcm5719-llvm-52bfc2b66835525fbfa23f9ab224f0eb33f50892.zip
[ARC] Complain about property without storage attribute when @synthesizing it, not at its declaration.
For this sample: @interface Foo @property id x; @end we get: t.m:2:1: error: ARC forbids properties of Objective-C objects with unspecified storage attribute @property id x; ^ 1 error generated. The error should be imposed on the implementor of the interface, not the user. If the user uses a header of a non-ARC library whose source code he does not have, we are basically asking him to go change the header of the library (bad in general), possible overriding how the property is implemented if he gets confused and says "Oh I'll just add 'copy' then" (even worse). Second issue is that we don't emit any error for 'readonly' properties, e.g: @interface Foo @property (readonly) id x; // no error here @end @implementation Foo @synthesize x; // no error here too @end We should give an error when the implementor is @synthesizing a property which doesn't have any storage specifier; this is when the explicit specifier is important, because we are going to create an ivar and we want its ownership to be explicit. Related improvements: -OBJC_PR_unsafe_unretained turned out to not fit in ObjCPropertyDecl's bitfields, fix it. -For properties of extension classes don't drop PropertyAttributesAsWritten values. -Have PropertyAttributesAsWritten actually only reflect what the user wrote rdar://9756610. llvm-svn: 134960
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud