https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110827
Bug ID: 110827 Summary: C++20 coroutines aren't being measured by gcov Product: gcc Version: 13.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: gcov-profile Assignee: unassigned at gcc dot gnu.org Reporter: mwd at md5i dot com CC: marxin at gcc dot gnu.org Target Milestone: --- Created attachment 55648 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55648&action=edit Simple bug exemplar When compiling with `--coverage` and running a program that utilizes C++20 coroutines, the statements in the coroutines aren't measured by gcov. Compile the attached file, `foo.cpp`, with: `g++ -std=c++20 --coverage -O0 -ggdb3 -o foo foo.cpp` Then run the resulting `foo`, followed by `gcov foo.cpp`. The resulting output in `foo.cpp.gcov` does not include lines 28 or 29 of `foo.cpp`, the contents of the coroutine `foo()`. In my tests this happens with any coroutine of any size, though functions called by a coroutine are covered properly.