You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I find that Clang's Source-Based Coverage does not report templates as "untested", leading to fake high coverage numbers.
I understand that templates are templates, and that they don't generate code until they are instantiated. That would make sense on coverage tools that depend on code being generated, like GCOV. But Clang is different, it operates on the AST - and the templates (even though not instantiated) definitely exist in the AST.
So I wonder why can't Clang report that template as untested? Is there anything I can do to achieve the desired behavior?
Hi!
I find that Clang's Source-Based Coverage does not report templates as "untested", leading to fake high coverage numbers.
I understand that templates are templates, and that they don't generate code until they are instantiated. That would make sense on coverage tools that depend on code being generated, like GCOV. But Clang is different, it operates on the AST - and the templates (even though not instantiated) definitely exist in the AST.
So I wonder why can't Clang report that template as untested? Is there anything I can do to achieve the desired behavior?
Example output:
The regular function clearly shows as untested (0 times executed), whereas the template function is not counted towards coverage.
Thanks!
The text was updated successfully, but these errors were encountered: