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

Member predicate LambdaCapture::isCapturedByReference

Holds if the variable was captured by reference.

An identifier is captured by reference if:

  • It is explicitly captured by reference.
  • It is implicitly captured, and the lambda’s default capture mode is by-reference.
  • The identifier is “this”. [Said behavior is dictated by the C++11 standard, but it is actually “*this” being captured rather than “this”.]
predicate isCapturedByReference()