Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions clang/test/Sema/shift-bool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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'}}
Expand All @@ -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'}}
}