Skip to content

Commit 3d5293c

Browse files
committed
update cpp test
1 parent 38a437b commit 3d5293c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

clang/test/Sema/shift-bool.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
void t() {
44
int x = 10;
55
bool y = true;
6+
int z = 1;
67

78
bool a = y << x;
89
bool b = y >> x; // expected-warning {{right shifting a 'bool' implicitly converts it to 'int'}}
@@ -20,6 +21,8 @@ void t() {
2021
bool i = y << 0;
2122
bool j = y >> 0; // expected-warning {{right shifting a 'bool' implicitly converts it to 'int'}}
2223

24+
bool k = (x < z) >> 1; // expected-warning {{right shifting a 'bool' implicitly converts it to 'int'}}
25+
2326
if ((y << 1) != 0) { }
2427
if ((y >> 1) != 0) { } // expected-warning {{right shifting a 'bool' implicitly converts it to 'int'}}
2528
}

0 commit comments

Comments
 (0)