From: Anders Carlsson Date: Wed, 25 Mar 2009 20:19:57 +0000 (+0000) Subject: It doesn't make sense to set the access specifier to AS_none (I think) X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b8547e800f9553a72c2f3635ae2371692bd4411a;p=clang It doesn't make sense to set the access specifier to AS_none (I think) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67700 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/AST/DeclBase.h b/include/clang/AST/DeclBase.h index abf5404882..a53b459c99 100644 --- a/include/clang/AST/DeclBase.h +++ b/include/clang/AST/DeclBase.h @@ -175,7 +175,10 @@ public: const_cast(this)->getDeclContext()); } - void setAccess(AccessSpecifier AS) { Access = AS; } + void setAccess(AccessSpecifier AS) { + assert(AS != AS_none && "Can't set access to none"); + Access = AS; + } AccessSpecifier getAccess() const { return AccessSpecifier(Access); } bool hasAttrs() const { return HasAttrs; }