Skip to content

Commit ad8a76d

Browse files
Update testcondition.cpp
1 parent 130cc52 commit ad8a76d

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎test/testcondition.cpp‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6650,6 +6650,13 @@ class TestCondition : public TestFixture {
66506650
"[test.cpp:2:28]: (style) Comparing expression of type 'signed int' against value 2147483647. Condition is always false. [compareValueOutOfTypeRangeError]\n"
66516651
"[test.cpp:7:17]: (style) Comparing expression of type 'signed int' against value 2147483647. Condition is always false. [compareValueOutOfTypeRangeError]\n",
66526652
errout_str());
6653+
6654+
check("enum E : std::uint8_t {};\n" // #11243
6655+
"void f(E e) {\n"
6656+
" if (e == 256) {}\n"
6657+
"}\n");
6658+
ASSERT_EQUALS("[test.cpp:3:14]: (style) Comparing expression of type 'unsigned char' against value 256. Condition is always false. [compareValueOutOfTypeRangeError]\n",
6659+
errout_str());
66536660
}
66546661

66556662
void knownConditionCast() {

0 commit comments

Comments
 (0)