Class Function::CopyConstructor

A C++ copy constructor, such as T::T(const T&) [N4140 12.8].

As per the standard, a copy constructor of class T is a non-template constructor whose first parameter has type T&, const T&, volatile T&, or const volatile T&, and either there are no other parameters, or the rest of the parameters all have default values.

For template classes, it can generally not be determined until instantiation whether a constructor is a copy constructor. For such classes, CopyConstructor over-approximates the set of copy constructors; if an under-approximation is desired instead, see the member predicate mayNotBeCopyConstructorInInstantiation.

Direct supertypes

Indirect supertypes

Predicates

mayNotBeCopyConstructorInInstantiation

Holds if we cannot determine that this constructor will become a copy constructor in all instantiations. Depending on template parameters of the enclosing class, this may become an ordinary constructor or a copy constructor.

Inherited predicates

accesses

Holds if this function accesses a function or variable or enumerator a.

from Function
accesses

Holds if this function accesses a function or variable or enumerator a in the Access expression l.

from Function
calls

Holds if this function calls the function f.

from Function
calls

Holds if this function calls the function f in the FunctionCall expression l.

from Function
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.

from AccessHolder
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).

from AccessHolder
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).

from AccessHolder
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
getACallToThisFunctionfrom Function
getADeclaration

Gets a child declaration of this function.

from Function
getADeclarationEntry

Gets a declaration entry corresponding to this declaration. The relationship between Declaration and DeclarationEntry is explained in Declaration.qll.

from Function
getADeclarationLocation

Gets the location of a FunctionDeclarationEntry corresponding to this declaration.

from Function
getAFalseSuccessor

Gets a node such that the control-flow edge (this, result) may be taken when this expression is false.

from ControlFlowNode
getAFile

Gets a file where this element occurs.

from Declaration
getALinkTarget

Gets a link target which compiled or referenced this function.

from Function
getAParameter

Gets a parameter of this function.

from Function
getAPredecessorfrom ControlFlowNode
getASpecifier

Gets a specifier of this function.

from Function
getASuccessorfrom ControlFlowNode
getATemplateArgument

Gets an argument used to instantiate this class from a template class.

from Function
getAThrownType

Gets a type that is specified to be thrown by the function.

from Function
getATrueSuccessor

Gets a node such that the control-flow edge (this, result) may be taken when this expression is true.

from ControlFlowNode
getAWrittenVariable

Gets a variable that is written-to in this function.

from Function
getAnAttribute

Gets an attribute of this function.

from Function
getAnInitializer

Gets an entry in the constructor’s initializer list, or a compiler-generated action which initializes a base class or member variable.

from Constructor
getAnOverload

Gets a function that overloads this one.

from Function
getAnOverriddenFunction

Gets a directly overridden function.

from MemberFunction
getAnOverridingFunction

Gets a directly overriding function.

from MemberFunction
getBasicBlockfrom ControlFlowNode
getBlock

Gets the block that is the function body.

from Function
getClassBodyDeclarationEntry

Gets the declaration entry for this member function that is within the class body.

from MemberFunction
getControlFlowScope

Implements ControlFlowNode.getControlFlowScope. The Function is used to represent the exit node of the control flow graph, so it is its own scope.

from Function
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 Function
getDefinitionLocation

Gets the location of the definition, if any.

from Function
getEffectiveNumberOfParameters

Gets the number of parameters of this function, including any implicit this parameter.

from MemberFunction
getEnclosingAccessHolder

Gets the nearest enclosing AccessHolder.

from Function
getEnclosingElement

Gets the closest Element enclosing this one.

from Element
getEnclosingStmt

Implements ControlFlowNode.getEnclosingStmt. The Function is used to represent the exit node of the control flow graph, so it has no enclosing statement.

from Function
getEntryPoint

Gets the first node in this function’s control flow graph.

from Function
getFile

Gets the primary file where this element occurs.

from Element
getFullSignature

Gets the full signature of this function, including return type, parameter types, and template arguments.

from Function
getInitializer

Gets an entry in the constructor’s initializer list, or a compiler-generated action which initializes a base class or member variable. The index specifies the order in which the initializer is to be evaluated.

from Constructor
getLocation

Gets the preferred location of this declaration. (The location of the definition, if possible.)

from Function
getMetrics

Gets the metric class. MetricFunction has methods for computing various metrics, such as “number of lines of code” and “number of function calls”.

from Function
getName

Gets the name of this declaration.

from Function
getNamespace

Gets the innermost namespace which contains this declaration.

from Declaration
getNumberOfParameters

Gets the number of parameters of this function, not including any implicit this parameter or any ... varargs pseudo-parameter.

from Function
getParameter

Gets the nth parameter of this function.

from Function
getParameterString

Gets a string representing the parameters of this function.

from Function
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
getTemplateArgument

Gets a particular argument used to instantiate this class from a template class.

from Function
getThrownType

Gets the ith type specified to be thrown by the function.

from Function
getType

Gets the return type of this function.

from Function
hasCLinkage

Holds if this function has C linkage, as specified by one of its declaration entries. For example: extern "C" void foo();.

from Function
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
hasEntryPoint

Holds if this function has an entry point.

from Function
hasExceptionSpecification

Holds if the function has an exception specification.

from Function
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
inMemberOrFriendOf

Holds if this can access private members of class c.

from AccessHolder
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
isCompilerGenerated

Holds if this function is generated by the compiler.

from Function
isCondition

Holds if this node is the top-level expression of a conditional statement, meaning that this.getATrueSuccessor() or this.getAFalseSuccessor() will have a result.

from ControlFlowNode
isConstructedFrom

Holds if this function is constructed from f as a result of template instantiation. If so, it originates either from a template function or from a function nested in a template class.

from Function
isDefault

Holds if this constructor serves as a default constructor.

from Constructor
isDefaulted

Holds if this function is explicitly defaulted with the = default specifier.

from Function
isDefinedfrom Declaration
isDeleted

Holds if this function is deleted. This may be because it was explicitly deleted with an = delete definition, or because the compiler was unable to auto-generate a definition for it.

from Function
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
isInline

Holds if this function is inline.

from Function
isMember

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

from Declaration
isMultiplyDefined

Holds if this function is defined in several files. This is illegal in C (though possible in some C++ compilers), and likely indicates that several functions that are not linked together have been compiled. An example would be a project with many ‘main’ functions.

from Function
isNaked

Holds if this function is declared with __attribute__((naked)) or __declspec(naked).

from Function
isNoExcept

Holds if this function has a noexcept exception specification.

from Function
isNoThrow

Holds if this function has a throw() exception specification.

from Function
isPrivate

Holds if this member is private.

from MemberFunction
isProtected

Holds if this member is protected.

from MemberFunction
isPublic

Holds if this member is public.

from MemberFunction
isSideEffectFree

Holds if this function is side-effect free (conservative approximation).

from Function
isSpecialization

Holds if this Function is a Template specialization.

from Function
isStatic

Holds if this declaration is static.

from Declaration
isTopLevel

Holds if this declaration is a top-level declaration.

from Declaration
isVarargs

Holds if this function is a varargs function.

from Function
isVirtual

Holds if this function is virtual.

from Function
mayHaveSideEffects

Holds if this function may have side-effects; if in doubt, we assume it may.

from Function
overrides

Holds if this function overrides that function.

from MemberFunction
toString

Gets a textual representation of this element.

from Declaration

Charpred