summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/lib/Sema/SemaObjCProperty.cpp2
-rw-r--r--clang/test/SemaObjC/synthesized-ivar.m3
2 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaObjCProperty.cpp b/clang/lib/Sema/SemaObjCProperty.cpp
index cda1f0be202..940366ae0de 100644
--- a/clang/lib/Sema/SemaObjCProperty.cpp
+++ b/clang/lib/Sema/SemaObjCProperty.cpp
@@ -356,7 +356,7 @@ Sema::DeclPtrTy Sema::ActOnPropertyImplDecl(SourceLocation AtLoc,
if (!Ivar) {
Ivar = ObjCIvarDecl::Create(Context, ClassImpDecl, PropertyLoc,
PropertyIvar, PropType, /*Dinfo=*/0,
- ObjCIvarDecl::Public,
+ ObjCIvarDecl::Protected,
(Expr *)0);
ClassImpDecl->addDecl(Ivar);
IDecl->makeDeclVisibleInContext(Ivar, false);
diff --git a/clang/test/SemaObjC/synthesized-ivar.m b/clang/test/SemaObjC/synthesized-ivar.m
index 465caf24a73..58bcf40a586 100644
--- a/clang/test/SemaObjC/synthesized-ivar.m
+++ b/clang/test/SemaObjC/synthesized-ivar.m
@@ -11,3 +11,6 @@
return IP;
}
@end
+
+// rdar: // 7823675
+int f0(I *a) { return a->IP; } // expected-error {{instance variable 'IP' is protected}}
OpenPOWER on IntegriCloud