Class FunctionDeclarationEntry
A particular declaration or definition of a C/C++ function. For example the
declaration and definition of MyFunction
in the following code are each a
FunctionDeclarationEntry
:
void MyFunction();
void MyFunction() {
DoSomething();
}
Import path
import cpp
Direct supertypes
Indirect supertypes
Predicates
getAParameterDeclarationEntry | Gets the declaration entry for a parameter of this function declaration. |
getAPrimaryQlClass | Gets the name of a primary CodeQL class to which this element belongs. |
getASpecifier | Gets a specifier associated with this declaration entry. |
getAThrownType | Gets a type that is specified to be thrown by the declared function. |
getBlock | If this is a function definition, get the block containing the function body. |
getCyclomaticComplexity | Gets the cyclomatic complexity of this function: |
getDeclaration | Gets the function which is being declared or defined. |
getEnclosingElement | Implements |
getFunction | Gets the function which is being declared or defined. |
getLocation | Gets the location of this declaration entry. |
getName | Gets the name of the function. |
getNoExceptExpr | If this declaration has a noexcept-specification [N4140 15.4], then this predicate returns the argument to |
getNumberOfLines | If this is a function definition, get the number of lines of code associated with it. |
getNumberOfParameters | Gets the number of parameters of this function declaration. |
getParameterDeclarationEntry | Gets the declaration entry for the nth parameter of this function declaration. |
getParameterString | Gets a string representing the parameters of this function declaration. |
getThrownType | Gets the |
getType | Gets the return type of the function which is being declared or defined. |
getTypedefType | Gets the typedef type (if any) used for this function declaration. As an example, the typedef type in the declaration of function foo in the following is Foo: |
hasCLinkage | Holds if this declaration entry specifies C linkage: |
hasExceptionSpecification | Holds if the declared function has an exception specification [N4140 15.4]. |
hasVoidParamList | Holds if this declaration entry has a void parameter list. |
isDefinition | Holds if this declaration is also a definition of its function. |
isImplicit | Holds if this declaration is an implicit function declaration, that is, where a function is used before it is declared (under older C standards, or when there were parse errors). |
isNoExcept | Holds if the declared function has an empty |
isNoThrow | Holds if the declared function has a |
isSpecialization | Holds if this declaration is a Template specialization. |
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 |
getCanonicalName | Gets the name associated with the corresponding definition (where available), or the name declared by this entry otherwise. | from DeclarationEntry |
getFile | Gets the primary file where this element occurs. | from Element |
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 |
getUnspecifiedType | Gets the type associated with this declaration entry after specifiers have been deeply stripped and typedefs have been resolved. | from DeclarationEntry |
hasSpecifier | Holds if this declaration entry has a specifier with the given name. | from DeclarationEntry |
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 |
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 |
toString | Gets a textual representation of this element. | from DeclarationEntry |