aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/Sema/SemaObjCProperty.cpp2
-rw-r--r--test/SemaObjC/property.m2
2 files changed, 3 insertions, 1 deletions
diff --git a/lib/Sema/SemaObjCProperty.cpp b/lib/Sema/SemaObjCProperty.cpp
index 33c5e71b5e..a4f782227a 100644
--- a/lib/Sema/SemaObjCProperty.cpp
+++ b/lib/Sema/SemaObjCProperty.cpp
@@ -508,7 +508,7 @@ Decl *Sema::ActOnPropertyImplDecl(Scope *S,
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);
diff --git a/test/SemaObjC/property.m b/test/SemaObjC/property.m
index 62291bb98c..8a4b1b63cc 100644
--- a/test/SemaObjC/property.m
+++ b/test/SemaObjC/property.m
@@ -63,3 +63,5 @@ typedef id BYObjectIdentifier;
@property int treeController; // expected-error {{property has a previous declaration}}
@end
+// rdar://10127639
+@synthesize window; // expected-error {{missing context for property implementation declaration}}