We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 38a437b commit 3d5293cCopy full SHA for 3d5293c
clang/test/Sema/shift-bool.cpp
@@ -3,6 +3,7 @@
3
void t() {
4
int x = 10;
5
bool y = true;
6
+ int z = 1;
7
8
bool a = y << x;
9
bool b = y >> x; // expected-warning {{right shifting a 'bool' implicitly converts it to 'int'}}
@@ -20,6 +21,8 @@ void t() {
20
21
bool i = y << 0;
22
bool j = y >> 0; // expected-warning {{right shifting a 'bool' implicitly converts it to 'int'}}
23
24
+ bool k = (x < z) >> 1; // expected-warning {{right shifting a 'bool' implicitly converts it to 'int'}}
25
+
26
if ((y << 1) != 0) { }
27
if ((y >> 1) != 0) { } // expected-warning {{right shifting a 'bool' implicitly converts it to 'int'}}
28
}
0 commit comments