Skip to content

Commit 27c5286

Browse files
committed
[coverage] fix for wrongly uncovered lines (add test for using in if constexpr init)
1 parent d20e6d7 commit 27c5286

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

clang/lib/CodeGen/CoverageMappingGen.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -1827,7 +1827,9 @@ struct CounterCoverageMappingBuilder
18271827
if (const auto *Init = S->getInit()) {
18281828
const auto start = getStart(Init);
18291829
const auto end = getEnd(Init);
1830-
1830+
1831+
// this check is to make sure typedef here which doesn't have valid source
1832+
// location won't crash it
18311833
if (start.isValid() && end.isValid()) {
18321834
markSkipped(startOfSkipped, start);
18331835
propagateCounts(ParentCount, Init);

0 commit comments

Comments
 (0)