https://github.com/a-tarasyuk created https://github.com/llvm/llvm-project/pull/130339
Fixes https://github.com/llvm/llvm-project/pull/127336#pullrequestreview-2665950553 >From bed2cb009ae2e560aa00f86b90c57d82f97bb435 Mon Sep 17 00:00:00 2001 From: Oleksandr T <oleksandr.taras...@outlook.com> Date: Fri, 7 Mar 2025 22:10:24 +0200 Subject: [PATCH] [Clang] add additional tests for -Wshift-bool --- clang/test/Sema/shift-bool.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/clang/test/Sema/shift-bool.cpp b/clang/test/Sema/shift-bool.cpp index a17a0e0ad9e7d..efaca65aacaed 100644 --- a/clang/test/Sema/shift-bool.cpp +++ b/clang/test/Sema/shift-bool.cpp @@ -3,6 +3,7 @@ void t() { int x = 10; bool y = true; + int z = 1; bool a = y << x; bool b = y >> x; // expected-warning {{right shifting a 'bool' implicitly converts it to 'int'}} @@ -22,4 +23,6 @@ void t() { if ((y << 1) != 0) { } if ((y >> 1) != 0) { } // expected-warning {{right shifting a 'bool' implicitly converts it to 'int'}} + + bool k = (x < z) >> 1; // expected-warning {{right shifting a 'bool' implicitly converts it to 'int'}} } _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits