]> granicus.if.org Git - clang/commitdiff
Updated comment for class ObjCIvarDecl: it turns out the default access control
authorTed Kremenek <kremenek@apple.com>
Wed, 23 Jul 2008 17:44:44 +0000 (17:44 +0000)
committerTed Kremenek <kremenek@apple.com>
Wed, 23 Jul 2008 17:44:44 +0000 (17:44 +0000)
is protected, not private.

Added ObjCIvarDecl::getCanonicalAccessControl() to report the visible access
control of an ivar, whereas getAccessControl() returns the access control
relating to how the ivar was actually declared.

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

include/clang/AST/DeclObjC.h

index 27760f2d765c49e150d1327a3d2ef1132eb2ea8f..264a84035db8ba5e60a8c7ee3576bf26d00632bf 100644 (file)
@@ -469,7 +469,7 @@ public:
 ///
 ///   @interface IvarExample : NSObject
 ///   {
-///     id defaultToPrivate; // same as C++.
+///     id defaultToProtected;
 ///   @public:
 ///     id canBePublic; // same as C++.
 ///   @protected:
@@ -488,8 +488,14 @@ public:
   enum AccessControl {
     None, Private, Protected, Public, Package
   };
+  
   void setAccessControl(AccessControl ac) { DeclAccess = ac; }
+
   AccessControl getAccessControl() const { return AccessControl(DeclAccess); }
+
+  AccessControl getCanonicalAccessControl() const {
+    return DeclAccess == None ? Protected : AccessControl(DeclAccess);
+  }
   
   // Implement isa/cast/dyncast/etc.
   static bool classof(const Decl *D) { return D->getKind() == ObjCIvar; }