From b16308f1b37237244022d06a467db14efb01b7c3 Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Wed, 26 Nov 2008 20:33:54 +0000 Subject: [PATCH] Removed a FIXME. Added a test case for anonymous category. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60115 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Sema/SemaDeclObjC.cpp | 8 ++++---- test/SemaObjC/continuation-class-err.m | 15 +++++++++++++++ 2 files changed, 19 insertions(+), 4 deletions(-) create mode 100644 test/SemaObjC/continuation-class-err.m diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp index 9f37e900cd..b9fc5b719a 100644 --- a/lib/Sema/SemaDeclObjC.cpp +++ b/lib/Sema/SemaDeclObjC.cpp @@ -1251,10 +1251,10 @@ Sema::DeclTy *Sema::ActOnProperty(Scope *S, SourceLocation AtLoc, *isOverridingProperty = true; return 0; } - // else - // FIXME: - // no matching property found in the main class. Must simply - // add this property to the main class's property list. + // No matching property found in the main class. Just fall thru + // and add property to the anonymous category. It looks like + // it works as is. This category becomes just like a category + // for its primary class. } else { Diag(CDecl->getLocation(), diag::err_continuation_class); *isOverridingProperty = true; diff --git a/test/SemaObjC/continuation-class-err.m b/test/SemaObjC/continuation-class-err.m new file mode 100644 index 0000000000..1d4725f887 --- /dev/null +++ b/test/SemaObjC/continuation-class-err.m @@ -0,0 +1,15 @@ +// RUN: clang -fsyntax-only -verify %s + +@interface ReadOnly +{ + id _object; + id _object1; +} +@property(readonly, assign) id object; +@property(readwrite, assign) id object1; +@end + +@interface ReadOnly () +@property(readwrite, copy) id object; // expected-warning {{property attribute in continuation class does not match the primary class}} +@property(readonly) id object1; // expected-error {{use contination class to override 'readonly' property with 'readwrite'}} +@end -- 2.40.0