BullseyeCoverage
An error such as shown below occurs.
Microsoft C++ |
error C2131: expression did not evaluate to a constant note: failure was caused by non-constant arguments or reference to a non-constant symbol note: see usage of 'cov_v_…' |
GNU C++ |
error: '…' called in a constant expression error: the value of 'cov_v_…' is not usable in a constant expression |
Clang |
error: … is not an integral constant expression note: read of non-constexpr variable 'cov_v_…' is not allowed in a constant expression |
A lambda expression is invoked in a context where a constant expression is required,
but the lambda expression is defined without constexpr
or consteval
.
When neither of these keywords are used,
BullseyeCoverage instruments the lambda expression.
Use one of the alternatives below.
constexpr
or consteval
to the lambda expression.
For example:
auto lambda = []() constexpr { return true; };
static_assert(lambda());
Updated: 3 Mar 2025
Copyright © Bullseye Testing Technology. All Rights Reserved.