Class FriendDecl
A C++ friend declaration [N4140 11.3]. For example the two friend
declarations in class A
of the following code:
class A {
friend void f(int);
friend class X;
};
void f(int x) { ... }
class X { ... };
Import path
import cpp
Direct supertypes
Indirect supertypes
Predicates
getADeclarationLocation | Gets the location of this friend declaration. The result is the location of the friend declaration itself, not the class or function that it refers to. Note: to get the target of the friend declaration, use |
getAPrimaryQlClass | Gets the name of a primary CodeQL class to which this element belongs. |
getASpecifier | Friend declarations do not have specifiers. It makes no difference whether they are declared in a public, protected or private section of the class. |
getDeclaringClass | Gets the declaring class (also known as the befriending class). For example: |
getDefinitionLocation | Implements the abstract method |
getFriend | Gets the target of this friend declaration. For example: |
getLocation | Gets the location of this friend declaration. |
getName | Gets a descriptive string for this friend declaration. |
isTopLevel | Holds if this declaration is a top-level declaration. |
Inherited predicates
findRootCause | Gets the source of this element: either itself or a macro that expanded to this element. | from Element |
fromSource | Holds if this element may be from source. This predicate holds for all elements, except for those in the dummy file, whose name is the empty string. The dummy file contains declarations that are built directly into the compiler. | from Element |
getADeclarationEntry | Gets a declaration entry corresponding to this declaration. See the comment above this class for an explanation of the relationship between | from Declaration |
getAFile | Gets a file where this element occurs. | from Declaration |
getATemplateArgument | Gets a template argument used to instantiate this declaration from a template. When called on a template, this will return a template parameter type for both typed and non-typed parameters. | from Declaration |
getATemplateArgumentKind | Gets a template argument used to instantiate this declaration from a template. When called on a template, this will return a non-typed template parameter value. | 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 |
getDescription | Gets a description of this | from Declaration |
getEnclosingElement | Gets the closest | from Element |
getFile | Gets the primary file where this element occurs. | from Element |
getNamespace | Gets the innermost namespace which contains this declaration. | from Declaration |
getNumberOfTemplateArguments | Gets the number of template arguments for this declaration. | from Declaration |
getParentScope | Gets the parent scope of this | from Element |
getPrimaryQlClasses | Gets a comma-separated list of the names of the primary CodeQL classes to which this element belongs. | from ElementBase |
getQualifiedName | Gets the name of the declaration, fully qualified with its namespace and declaring type. | from Declaration |
getTemplateArgument | Gets the | from Declaration |
getTemplateArgumentKind | Gets the | 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 |
hasGlobalOrStdName | Holds if this declaration has the given name in the global namespace or the | from Declaration |
hasGlobalOrStdOrBslName | Holds if this declaration has the given name in the global namespace, the | from Declaration |
hasName | Holds if this declaration has the given name. | from Declaration |
hasQualifiedName | DEPRECATED: Prefer | from Declaration |
hasQualifiedName | Holds if this declaration has a fully-qualified name with a name-space component of | from Declaration |
hasQualifiedName | Holds if this declaration has a fully-qualified name with a name-space component of | from 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 | from Element |
isDefined | DEPRECATED: Use | from Declaration |
isFromTemplateInstantiation | Holds if this | from Element |
isFromUninstantiatedTemplate | Holds if this | 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 | 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 |
toString | Gets a textual representation of this element. | from Declaration |