Le 11 mars 2013 à 23:26, Fariborz Jahanian <[email protected]> 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 > +@property (nonatomic, retain) ClassBase * foo; > +@end > + > +@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}} > +} > +@end > + > +@interface ClassDerived : ClassBase > +@property (nonatomic, retain) ClassDerived * foo; > +@end > + > +@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 ? > + [super setFoo:foo]; // works with no warning > +} > +@end -- Jean-Daniel _______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
