From: Fariborz Jahanian Date: Tue, 6 Apr 2010 23:36:17 +0000 (+0000) Subject: default access for synthesize ivar is @protect. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2846b2b47029c877357438d16c73911c1510be6c;p=clang default access for synthesize ivar is @protect. Fixes radar 7823675. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@100582 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaObjCProperty.cpp b/lib/Sema/SemaObjCProperty.cpp index cda1f0be20..940366ae0d 100644 --- a/lib/Sema/SemaObjCProperty.cpp +++ b/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/test/SemaObjC/synthesized-ivar.m b/test/SemaObjC/synthesized-ivar.m index 465caf24a7..58bcf40a58 100644 --- a/test/SemaObjC/synthesized-ivar.m +++ b/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}}