[PATCH] D132723: [Clang] Fix crash in coverage of if consteval.

Corentin Jabot via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 26 01:24:48 PDT 2022


cor3ntin created this revision.
Herald added a project: All.
cor3ntin requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Clang crashes when encountering an `if consteval` statement.
This is the minimum fix not to crash.
The fix is consistent with the current behavior of if constexpr,
which does generate coverage data for the discarded branches.
This is of course not correct and a better solution is
needed for both if constexpr and if consteval.
See https://github.com/llvm/llvm-project/issues/54419.

Fixes #57377


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D132723

Files:
  clang/lib/CodeGen/CoverageMappingGen.cpp
  clang/test/CoverageMapping/if.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D132723.455829.patch
Type: text/x-patch
Size: 4436 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220826/9ccbd3e2/attachment.bin>


More information about the cfe-commits mailing list