]> granicus.if.org Git - clang/commitdiff
default access for synthesize ivar is @protect.
authorFariborz Jahanian <fjahanian@apple.com>
Tue, 6 Apr 2010 23:36:17 +0000 (23:36 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Tue, 6 Apr 2010 23:36:17 +0000 (23:36 +0000)
Fixes radar 7823675.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100582 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaObjCProperty.cpp
test/SemaObjC/synthesized-ivar.m

index cda1f0be2023a03a760cf070c4532c6700acb732..940366ae0de5cf72c45641503760b4c153a953e7 100644 (file)
@@ -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);
index 465caf24a73643a952cd19cf92ddde9e033c0f83..58bcf40a58602db70c9be1cc159e644c3a9f446f 100644 (file)
@@ -11,3 +11,6 @@
    return IP;
 }
 @end
+
+// rdar: // 7823675
+int f0(I *a) { return a->IP; } // expected-error {{instance variable 'IP' is protected}}