]> granicus.if.org Git - clang/commitdiff
error on property of objc interface type instead of crashing
authorFariborz Jahanian <fjahanian@apple.com>
Wed, 12 Aug 2009 18:17:53 +0000 (18:17 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Wed, 12 Aug 2009 18:17:53 +0000 (18:17 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78826 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaDeclObjC.cpp
test/SemaObjC/invalid-objc-decls-1.m

index 18536afcf7a0d51ee242e1ff12dcb6150e11c579..75ac33673ca2abbdaf480d6047d81c3c13f025ba 100644 (file)
@@ -1940,6 +1940,8 @@ Sema::DeclPtrTy Sema::ActOnProperty(Scope *S, SourceLocation AtLoc,
               Diag(AtLoc, diag::warn_implements_nscopying)  
                 << FD.D.getIdentifier();
       }
+  if (T->isObjCInterfaceType())
+    Diag(FD.D.getIdentifierLoc(), diag::err_statically_allocated_object);
   
   DeclContext *DC = dyn_cast<DeclContext>(ClassDecl);
   assert(DC && "ClassDecl is not a DeclContext");
index e3a94f62d5a60143a73d02913f90d1bf2f7ead94..4a3732eff188aec3df18a897f5bc4fe6bd9a10ca 100644 (file)
@@ -32,3 +32,11 @@ Super foo( // expected-error{{interface interface type 'Super' cannot be returne
        Super p1; // expected-error{{interface type cannot be statically allocated}}
        return p1;
 }
+
+@interface NSMutableSet @end
+
+@interface DVTDummyAnnotationProvider  
+  @property(readonly) NSMutableSet annotations;        // expected-error{{interface type cannot be statically allocated}}
+
+@end
+