Author: rjmccall
Date: Tue Feb 21 15:48:05 2012
New Revision: 151089

URL: http://llvm.org/viewvc/llvm-project?rev=151089&view=rev
Log:
Don't crash on attempts to synthesize an invalid property.
rdar://problem/10904479

Modified:
    cfe/trunk/lib/Sema/SemaObjCProperty.cpp
    cfe/trunk/test/SemaObjC/arc-property.m

Modified: cfe/trunk/lib/Sema/SemaObjCProperty.cpp
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaObjCProperty.cpp?rev=151089&r1=151088&r2=151089&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaObjCProperty.cpp (original)
+++ cfe/trunk/lib/Sema/SemaObjCProperty.cpp Tue Feb 21 15:48:05 2012
@@ -1777,6 +1777,7 @@
           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 }.

Modified: cfe/trunk/test/SemaObjC/arc-property.m
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/arc-property.m?rev=151089&r1=151088&r2=151089&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/arc-property.m (original)
+++ cfe/trunk/test/SemaObjC/arc-property.m Tue Feb 21 15:48:05 2012
@@ -46,3 +46,12 @@
 @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


_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to