=?utf-8?q?Björn?= Svensson <[email protected]>,
=?utf-8?q?Björn?= Svensson <[email protected]>,
=?utf-8?q?Björn?= Svensson <[email protected]>,
=?utf-8?q?Björn?= Svensson <[email protected]>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/[email protected]>
================
@@ -0,0 +1,792 @@
+// RUN: %check_clang_tidy -std=c23-or-later %s
readability-simplify-boolean-expr %t
+
+bool a1 = false;
+
+void if_with_bool_literal_condition() {
+ int i = 0;
+ if (false) {
+ i = 1;
+ } else {
+ i = 2;
+ }
+ i = 3;
+ // CHECK-MESSAGES: :[[@LINE-6]]:7: warning: {{.*}} in if statement condition
+ // CHECK-FIXES: {{^ int i = 0;$}}
----------------
vbvictor wrote:
Also, ideally match whole lines without `{{` here and later, but as I see other
tests of boolean-expr so It's okay.
https://github.com/llvm/llvm-project/pull/178392
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits