[cfe-commits] r139988 - in /cfe/trunk: lib/Sema/SemaObjCProperty.cpp test/SemaObjC/property.m
Fariborz Jahanian
fjahanian at apple.com
Sat Sep 17 11:48:50 PDT 2011
Author: fjahanian
Date: Sat Sep 17 13:48:50 2011
New Revision: 139988
URL: http://llvm.org/viewvc/llvm-project?rev=139988&view=rev
Log:
objc: Don't crash with decl context for property impl.
is missing. // rdar//10127639
Modified:
cfe/trunk/lib/Sema/SemaObjCProperty.cpp
cfe/trunk/test/SemaObjC/property.m
Modified: cfe/trunk/lib/Sema/SemaObjCProperty.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaObjCProperty.cpp?rev=139988&r1=139987&r2=139988&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaObjCProperty.cpp (original)
+++ cfe/trunk/lib/Sema/SemaObjCProperty.cpp Sat Sep 17 13:48:50 2011
@@ -508,7 +508,7 @@
IdentifierInfo *PropertyIvar,
SourceLocation PropertyIvarLoc) {
ObjCContainerDecl *ClassImpDecl =
- cast_or_null<ObjCContainerDecl>(CurContext);
+ dyn_cast_or_null<ObjCContainerDecl>(CurContext);
// Make sure we have a context for the property implementation declaration.
if (!ClassImpDecl) {
Diag(AtLoc, diag::error_missing_property_context);
Modified: cfe/trunk/test/SemaObjC/property.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/property.m?rev=139988&r1=139987&r2=139988&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/property.m (original)
+++ cfe/trunk/test/SemaObjC/property.m Sat Sep 17 13:48:50 2011
@@ -63,3 +63,5 @@
@property int treeController; // expected-error {{property has a previous declaration}}
@end
+// rdar://10127639
+ at synthesize window; // expected-error {{missing context for property implementation declaration}}
More information about the cfe-commits
mailing list