-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Source-based code coverage incorrectly handles if constexpr block #54419
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
When viewing the AST of this program, the body of
|
|
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 #54419. Fixes #57377 Reviewed By: aaron.ballman Differential Revision: https://reviews.llvm.org/D132723
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 llvm#54419. Fixes llvm#57377 Reviewed By: aaron.ballman Differential Revision: https://reviews.llvm.org/D132723
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 llvm/llvm-project#54419. Fixes #57377 Reviewed By: aaron.ballman Differential Revision: https://reviews.llvm.org/D132723
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 llvm/llvm-project#54419. Fixes #57377 Reviewed By: aaron.ballman Differential Revision: https://reviews.llvm.org/D132723
I have a fix in mentioned PR. There was incorrectly marked one character after |
@llvm/issue-subscribers-clang-frontend Author: Paweł Bylica (chfast)
When a `if constexpr` has a block `{}` and the condition is false, the source-based code coverage always marks the opening `{` as not-executed region (see line 4).
Tested with clang 14.
|
@llvm/issue-subscribers-clang-codegen Author: Paweł Bylica (chfast)
When a `if constexpr` has a block `{}` and the condition is false, the source-based code coverage always marks the opening `{` as not-executed region (see line 4).
Tested with clang 14.
|
And I'm working on continuation of previous PR for |
…rt (llvm#77214) Replace the discarded statement by an empty compound statement so we can keep track of the whole source range we need to skip in coverage Fixes llvm#54419
When a
if constexpr
has a block{}
and the condition is false, the source-based code coverage always marks the opening{
as not-executed region (see line 4).Tested with clang 14.
The text was updated successfully, but these errors were encountered: