Thank you for this suggestion, but gcovr will already report zero coverage for uncovered files! It is sufficient if the source file is referenced in a .gcno file that the compiler generates, and it is not necessary that a .gcda file was created during test execution.
However, gcov/gcovr cannot know about dead code that the compiler eliminated. If a file only consists of dead code (like a C++ template that was never instantiated, or a static function that was never called), it will not be considered as uncovered – it simply does not exist as far as gcovr is concerned. There is no good workaround.
I'm closing this issue because AFAIK this feature already exists. If you have a problem with un-executed files, please add the relevant details so that I can reopen. E.g. the output of running gcovr in --verbose mode on a small example project that demonstrates the problem.
No problem! However, this feature has been around for a long time.
According to the changelog this was released back in version 2.4 from 2012-04-13. The original ticket on Sandia's Trac is #3887 (from before gcovr was developed on GitHub). The original implementation is in commit f1296c8.