How consteval and constexpr Impact gcov
I was curious how the gcov line coverage analysis tool would handle code which is evaluated at compile time. I threw together a few simple examples utilizing consteval and constexpr statements in various contexts. In this article I go over those examples and images of the corresponding lcov report for easy viewing. The main takeaway is not surprising given gcov works by instrumenting compiled binaries - the coverage reports omit any lines of code which do not manifest in the compiled binary. There are some potentially interesting behaviors though, especially around use of constexpr functions at runtime. ...