[all-commits] [llvm/llvm-project] 463e30: [Clang] Fix crash in coverage of if consteval.

cor3ntin via All-commits all-commits at lists.llvm.org
Fri Aug 26 08:47:10 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 463e30f51fd07921f32c6630afb3f8dd18d6d2f5
      https://github.com/llvm/llvm-project/commit/463e30f51fd07921f32c6630afb3f8dd18d6d2f5
  Author: Corentin Jabot <corentinjabot at gmail.com>
  Date:   2022-08-26 (Fri, 26 Aug 2022)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/lib/CodeGen/CoverageMappingGen.cpp
    M clang/test/CoverageMapping/if.cpp

  Log Message:
  -----------
  [Clang] Fix crash in coverage of if consteval.

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

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D132723




More information about the All-commits mailing list