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

Member predicate Expr::isConstant

Holds if this expression has a value that can be determined at compile time.

An expression has a value that can be determined at compile time when:

  • it is a compile-time constant, e.g., a literal value or the result of a constexpr compile-time constant;
  • it is an address of a (member) function, an address of a constexpr variable initialized to a constant address, or an address of an lvalue, or any of the previous with a constant value added to or subtracted from the address;
  • it is a reference to a (member) function, a reference to a constexpr variable initialized to a constant address, or a reference to an lvalue;
  • it is a non-template parameter of a uninstantiated template.
predicate isConstant()