CodeQL library for C/C++
codeql/cpp-all 0.12.12-dev (changelog, source)
Search

Member predicate Function::isConstexpr

Holds if this function is constexpr. Normally, this holds if and only if isDeclaredConstexpr() holds, but in some circumstances they differ. For example, with

int f(int i) { return 6; }
template <typename T> constexpr int g(T x) { return f(x); }

g<int> is declared constexpr, but is not constexpr.

Will also hold if this function is consteval.

predicate isConstexpr()