We are using clang to run unit tests and generate coverage reports for this file.
The llvm marks the ctor block lines from 154-195 as uninstrumented. Infact we believe they should be marked as instrumented. I am attaching the screenshot of the code coverage report. As you can see the lines below 196 and lines above 145 are considered as instrumented, while lines 154-194 are not.
Can someone please clarify why ctor calls are not considered as src code lines by the compiler?
Because line 195 is the start position of the constructor (identified by left brace), lines 154-194 are not considered covered by frontend. Lines starting from 195 are instrumented and covered, so this constructor is instrumented.
brace-init-list elements from 154 to 194 are evaluated in scope of the constructor, and result in executable instructions. Which means they have been executed. Why then they are considered uninstrumented?
I guess it’s simply because at the clang coverage instrumentation stage, the start location of a function is identified by the left brace of the function body. However, I think it can be improved to use ‘:’ after ctor as the start location if it exists otherwise use ‘{’.
brace-init-list elements from 154 to 194 are evaluated in scope of the constructor, and result in executable instructions. Which means they have been executed. Why then they are considered uninstrumented?