Skip to content

Commit 3e67a51

Browse files
Update teststl.cpp
1 parent f5670d1 commit 3e67a51

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

test/teststl.cpp

+7-1
Original file line numberDiff line numberDiff line change
@@ -692,13 +692,19 @@ class TestStl : public TestFixture {
692692
" if (i <= static_cast<int>(v.size())) {\n"
693693
" if (v[i]) {}\n"
694694
" }\n"
695+
" if (i <= int(v.size())) {\n"
696+
" if (v[i]) {}\n"
697+
" }\n"
695698
"}\n");
696699
ASSERT_EQUALS("test.cpp:3:warning:Either the condition 'i<=(int)v.size()' is redundant or 'i' can have the value v.size(). Expression 'v[i]' causes access out of bounds.\n"
697700
"test.cpp:2:note:condition 'i<=(int)v.size()'\n"
698701
"test.cpp:3:note:Access out of bounds\n"
699702
"test.cpp:6:warning:Either the condition 'i<=static_cast<int>(v.size())' is redundant or 'i' can have the value v.size(). Expression 'v[i]' causes access out of bounds.\n"
700703
"test.cpp:5:note:condition 'i<=static_cast<int>(v.size())'\n"
701-
"test.cpp:6:note:Access out of bounds\n",
704+
"test.cpp:6:note:Access out of bounds\n"
705+
"test.cpp:9:warning:Either the condition 'i<=int(v.size())' is redundant or 'i' can have the value v.size(). Expression 'v[i]' causes access out of bounds.\n"
706+
"test.cpp:8:note:condition 'i<=int(v.size())'\n"
707+
"test.cpp:9:note:Access out of bounds\n",
702708
errout_str());
703709

704710
check("template<class Iterator>\n"

0 commit comments

Comments
 (0)