CodeQL library for C/C++
Search

Module Call

Provides classes for modeling call expressions including direct calls to functions, constructor and destructor calls, and calls made through function pointers.

Import path

import semmle.code.cpp.exprs.Call

Imports

Expr

Provides classes modeling C/C++ expressions.

Function

Provides classes for working with functions, including template functions.

Classes

Call

A C/C++ call.

ConstructorBaseInit

A call to a constructor of a base class as part of a constructor’s initializer list or compiler-generated actions.

ConstructorCall

A call to a constructor. struct S { S(void) {} }; S s;

ConstructorDelegationInit

A call to a constructor of the same class as part of a constructor’s initializer list, which delegates object construction (C++11 only). struct S { int a; S(int b): a(b) { } S(): S(0) { } // delegation to another constructor };

ConstructorDirectInit

A call to a constructor of a direct non-virtual base class as part of a constructor’s initializer list or compiler-generated actions. struct S { int a; S(int b): a(b) {} }; struct T: S { T(): S(33) {} // S(33) is a constructor call };

ConstructorFieldInit

An initialization of a member variable performed as part of a constructor’s explicit initializer list or implicit actions. In the example below, member variable b is being initialized by constructor parameter a: struct S { int b; S(int a): b(a) {} } s(2);

ConstructorInit

An initialization of a base class or member variable performed as part of a constructor’s explicit initializer list or implicit actions.

ConstructorVirtualInit

A call to a constructor of a virtual base class as part of a constructor’s initializer list or compiler-generated actions.

DestructorBaseDestruction

A call to a destructor of a base class as part of a destructor’s compiler-generated actions.

DestructorCall

A call to a destructor. struct S { ~S(void) {} } *s; s->~S();

DestructorDestruction

A call to a destructor of a base class or field as part of a destructor’s compiler-generated actions.

DestructorDirectDestruction

A call to a destructor of a direct non-virtual base class as part of a destructor’s compiler-generated actions. struct S { ~S(void) {} }; struct T: S { ~T(void) {} // will call ~S() };

DestructorFieldDestruction

A destruction of a member variable performed as part of a destructor’s compiler-generated actions. struct S { ~S(void) {} }; struct T { S s; ~T(void) {} // will call s.~S() };

DestructorVirtualDestruction

A call to a destructor of a direct virtual base class as part of a destructor’s compiler-generated actions.

ExprCall

A C/C++ call which is performed through a function pointer.

FunctionCall

A C/C++ function call where the name of the target function is known at compile-time.

OverloadedArrayExpr

An instance of a user-defined binary operator[] applied to its arguments. struct T2 { T1 operator[](const T3 &); }; T1 a; T2 b; T3 c; a = b[c];

OverloadedPointerDereferenceExpr

An instance of a user-defined unary operator* applied to its argument. T1 operator*(const T2 &); T1 a; T2 b; a = *b;

OverloadedPointerDereferenceFunction

A user-defined unary operator* function.

VacuousDestructorCall

An expression that looks like a destructor call, but has no effect.

VariableCall

A C/C++ call which is performed through a variable of function pointer type. int call_via_ptr(int (*pfn)(int)) { return pfn(5); }