[clang] [coverage] fix crash in code coverage and `if constexpr` with `ExprWithCleanups` (PR #80292)
Hana Dusíková via cfe-commits
cfe-commits at lists.llvm.org
Thu Feb 1 13:28:56 PST 2024
================
@@ -234,6 +234,35 @@ constexpr int check_macro_consteval_if_skipped(int i) { // CHECK-NEXT: [[@LINE
return i;
}
+struct false_value {
+ constexpr operator bool() {
+ return false;
+ }
+};
+
+template <typename> struct dependable_false_value {
+ constexpr operator bool() {
+ return false;
+ }
+};
+
+// GH-80285
+void should_not_crash() {
+ if constexpr (false_value{}) { };
----------------
hanickadot wrote:
Thanks!
https://github.com/llvm/llvm-project/pull/80292
More information about the cfe-commits
mailing list