[cfe-commits] r151089 - in /cfe/trunk: lib/Sema/SemaObjCProperty.cpp test/SemaObjC/arc-property.m
John McCall
rjmccall at apple.com
Tue Feb 21 13:48:06 PST 2012
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.
+ at interface Test2
+// Minor FIXME: kill the redundant error
+ at property (strong) UndeclaredClass *test2; // expected-error {{unknown type name 'UndeclaredClass'}} expected-error {{must be of object type}}
+ at end
+ at implementation Test2
+ at synthesize test2;
+ at end
More information about the cfe-commits
mailing list