Class Declaration::AccessHolder

A declaration that can potentially have more C++ access rights than its enclosing element. This comprises Class (they have access to their own private members) along with other UserTypes and Function (they can be the target of friend declarations).

In the C++ standard (N4140 11.2), rules for access control revolve around the informal phrase “R occurs in a member or friend of class C”, where AccessHolder corresponds to this R.

Direct supertypes

Indirect supertypes

Known direct subtypes

Predicates

canAccessClass

Holds if a base class base of derived is accessible at this (N4140 11.2/4). When this holds, and derived has only one base subobject of type base, code in this can implicitly convert a pointer to derived into a pointer to base. Conversely, if such a conversion is possible then this predicate holds.

canAccessMember

Holds if a non-static member member is accessible at this when named in a class derived that is derived from or equal to the declaring class of member (N4140 11.2/5 and 11.4).

couldAccessMember

Holds if a hypothetical non-static member of memberClass with access specifier memberAccess is accessible at this when named in a class derived that is derived from or equal to memberClass (N4140 11.2/5 and 11.4).

getEnclosingAccessHolder

Gets the nearest enclosing AccessHolder.

inMemberOrFriendOf

Holds if this can access private members of class c.

Inherited predicates

findRootCause

Gets the source of this element: either itself or a macro that expanded to this element.

from Element
fromLibrary

Holds if this element may be from a library.

from Element
fromSource

Holds if this element may be from source.

from Element
getADeclarationEntry

Gets a declaration entry corresponding to this declaration. See the comment above this class for an explanation of the relationship between Declaration and DeclarationEntry.

from Declaration
getADeclarationLocation

Gets the location of a declaration entry corresponding to this declaration.

from Declaration
getAFile

Gets a file where this element occurs.

from Declaration
getASpecifier

Gets a specifier of this declaration.

from Declaration
getDeclaringType

Gets the class where this member is declared, if it is a member. For templates, both the template itself and all instantiations of the template are considered to have the same declaring class.

from Declaration
getDefinition

Gets the declaration entry corresponding to this declaration that is a definition, if any.

from Declaration
getDefinitionLocation

Gets the location of the definition, if any.

from Declaration
getEnclosingElement

Gets the closest Element enclosing this one.

from Element
getFile

Gets the primary file where this element occurs.

from Element
getLocation

Gets the preferred location of this declaration, if any.

from Declaration
getName

Gets the name of this declaration.

from Declaration
getNamespace

Gets the innermost namespace which contains this declaration.

from Declaration
getParentScope

Gets the parent scope of this Element, if any. A scope is a Type (Class / Enum), a Namespace, a Block, a Function, or certain kinds of Statement.

from Element
getQualifiedName

Gets the name of the declaration, fully qualified with its namespace. For example: “A::B::C::myfcn”.

from Declaration
hasDeclaringType

Holds if this declaration is a member of a class/struct/union.

from Declaration
hasDefinition

Holds if the declaration has a definition.

from Declaration
hasGlobalName

Holds if this declaration has the given name in the global namespace.

from Declaration
hasName

Holds if this declaration has the given name.

from Declaration
hasQualifiedNamefrom Declaration
hasSpecifier

Holds if this declaration has a specifier with the given name.

from Declaration
isAffectedByMacro

Holds if this element is affected in any way by a macro. All elements that are totally or partially generated by a macro are included, so this is a super-set of isInMacroExpansion.

from Element
isDefinedfrom Declaration
isFromTemplateInstantiation

Holds if this Element is a part of a template instantiation (but not the template itself).

from Element
isFromUninstantiatedTemplate

Holds if this Element is part of a template template (not if it is part of an instantiation of template). This means it is represented in the database purely as syntax and without guarantees on the presence or correctness of type-based operations such as implicit conversions.

from Element
isInMacroExpansion

Holds if this element comes from a macro expansion. Only elements that are entirely generated by a macro are included - for elements that partially come from a macro, see isAffectedByMacro.

from Element
isMember

Holds if this declaration is a member of a class/struct/union.

from Declaration
isStatic

Holds if this declaration is static.

from Declaration
isTopLevel

Holds if this declaration is a top-level declaration.

from Declaration
toString

Gets a textual representation of this element.

from Declaration