]> granicus.if.org Git - clang/commitdiff
Don't crash on attempts to synthesize an invalid property.
authorJohn McCall <rjmccall@apple.com>
Tue, 21 Feb 2012 21:48:05 +0000 (21:48 +0000)
committerJohn McCall <rjmccall@apple.com>
Tue, 21 Feb 2012 21:48:05 +0000 (21:48 +0000)
rdar://problem/10904479

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151089 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaObjCProperty.cpp
test/SemaObjC/arc-property.m

index f9c064d99712b97425b5b3f7925d95569f2aa84a..5df214fd9fb1fb26d63d7699811911ece6f4cf51 100644 (file)
@@ -1777,6 +1777,7 @@ void Sema::CheckObjCPropertyAttributes(Decl *PDecl,
           Attributes & ObjCDeclSpec::DQ_PR_copy ? "copy" : "retain (or strong)");
     Attributes &= ~(ObjCDeclSpec::DQ_PR_weak   | ObjCDeclSpec::DQ_PR_copy |
                     ObjCDeclSpec::DQ_PR_retain | ObjCDeclSpec::DQ_PR_strong);
+    PropertyDecl->setInvalidDecl();
   }
 
   // Check for more than one of { assign, copy, retain }.
index 2993118592033e8c0ccece73577cd35ce17cf902..226b03b3ae120377da9fb83fc7dda0204b79ab98 100644 (file)
 @synthesize z;  // suppressed
 @end
 
+// rdar://problem/10904479
+// Don't crash.
+@interface Test2
+// Minor FIXME: kill the redundant error
+@property (strong) UndeclaredClass *test2;  // expected-error {{unknown type name 'UndeclaredClass'}} expected-error {{must be of object type}}
+@end
+@implementation Test2
+@synthesize test2;
+@end