r176832 - Objective-C: When using super.prop, property should be

jahanian fjahanian at apple.com
Tue Mar 12 08:52:24 PDT 2013


On Mar 12, 2013, at 7:55 AM, Jean-Daniel Dupas <devlists at shadowlab.org> wrote:

> 
> Le 11 mars 2013 à 23:26, Fariborz Jahanian <fjahanian at apple.com> a écrit :
> 
>> Author: fjahanian
>> Date: Mon Mar 11 17:26:33 2013
>> New Revision: 176832
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=176832&view=rev
>> Log:
>> Objective-C: When using super.prop, property should be
>> looked up the current class's super class.
>> // rdar://13349296
>> 
>> Modified:
>>   cfe/trunk/lib/Sema/SemaExprObjC.cpp
>>   cfe/trunk/test/Coverage/objc-language-features.inc
>>   cfe/trunk/test/SemaObjC/super-property-notation.m
> 
>> 
>> 
>> Modified: cfe/trunk/test/SemaObjC/super-property-notation.m
>> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/super-property-notation.m?rev=176832&r1=176831&r2=176832&view=diff
>> ==============================================================================
>> --- cfe/trunk/test/SemaObjC/super-property-notation.m (original)
>> +++ cfe/trunk/test/SemaObjC/super-property-notation.m Mon Mar 11 17:26:33 2013
>> @@ -1,5 +1,4 @@
>> -// RUN: %clang_cc1 -fsyntax-only -verify %s
>> -// expected-no-diagnostics
>> +// RUN: %clang_cc1 -fsyntax-only -fobjc-default-synthesize-properties -verify %s
>> 
>> @interface B
>> +(int) classGetter;
>> @@ -29,3 +28,25 @@ void f0() {
>>  int l2 = [A classGetter2];
>> }
>> 
>> +// rdar://13349296
>> +__attribute__((objc_root_class)) @interface ClassBase 
>> + at property (nonatomic, retain) ClassBase * foo;
>> + at end
>> +
>> + at implementation ClassBase 
>> +- (void) Meth:(ClassBase*)foo {
>> +  super.foo = foo; // expected-error {{'ClassBase' cannot use 'super' because it is a root class}}
>> +  [super setFoo:foo]; // expected-error {{'ClassBase' cannot use 'super' because it is a root class}}
>> +}
>> + at end
>> +
>> + at interface ClassDerived : ClassBase 
>> + at property (nonatomic, retain) ClassDerived * foo;
>> + at end
>> +
>> + at implementation ClassDerived
>> +- (void) Meth:(ClassBase*)foo {
>> +  super.foo = foo; // issues compile warning
> 
> 
> If it issues a compile warning, why is there no expected-warning {{ }} here ? 
> 

No. This was user's original complaint. I will remove user's comment. Thanks for noticing it.
- Fariborz

> 
>> +  [super setFoo:foo]; // works with no warning
>> +}
>> + at end
> 
> -- Jean-Daniel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130312/70726a90/attachment.html>


More information about the cfe-commits mailing list