summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2010-04-06 23:36:17 +0000
committerFariborz Jahanian <fjahanian@apple.com>2010-04-06 23:36:17 +0000
commitb2c1aac54428861966fa0db807e7bb96ca0651f7 (patch)
tree9304019b049aacf43bc3134da09f96dfee41da01
parent796583eec09945a028353f0a0ae669b9f622c5cc (diff)
downloadbcm5719-llvm-b2c1aac54428861966fa0db807e7bb96ca0651f7.tar.gz
bcm5719-llvm-b2c1aac54428861966fa0db807e7bb96ca0651f7.zip
default access for synthesize ivar is @protect.
Fixes radar 7823675. llvm-svn: 100582
-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