Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions cpp/ql/src/semmle/code/cpp/MemberFunction.qll
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,14 @@ class MemberFunction extends Function {
result = getADeclarationEntry() and result != getDefinition()
)
}

/**
* Gets the type of the `this` parameter associated with this member function, if any. Typically,
* this will be a `PointerType`, possibly with `const` and/or `volatile` qualifiers.
*/
Type getTypeOfThis() {
member_function_this_type(underlyingElement(this), unresolveElement(result))
}
}

/**
Expand Down
2 changes: 1 addition & 1 deletion cpp/ql/src/semmlecode.cpp.dbscheme
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ function_deleted(unique int id: @function ref);

function_defaulted(unique int id: @function ref);


member_function_this_type(unique int id: @function ref, int this_type: @type ref);

#keyset[id, type_id]
fun_decls(
Expand Down
Loading