Skip to content

Commit 3b5dabd

Browse files
committed
Clarified errormessage of checkBoost
1 parent 003a9be commit 3b5dabd

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

lib/checkboost.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,6 @@ void CheckBoost::checkBoostForeachModification()
5151
void CheckBoost::boostForeachError(const Token *tok)
5252
{
5353
reportError(tok, Severity::error, "boostForeachError",
54-
"BOOST_FOREACH caches the end() iterator. It's undefined behavior if you modify the container."
54+
"BOOST_FOREACH caches the end() iterator. It's undefined behavior if you modify the container inside."
5555
);
5656
}

test/testboost.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,31 +61,31 @@ class TestBoost : public TestFixture {
6161
" data.push_back(123);\n"
6262
" }\n"
6363
"}");
64-
ASSERT_EQUALS("[test.cpp:4]: (error) BOOST_FOREACH caches the end() iterator. It's undefined behavior if you modify the container.\n", errout.str());
64+
ASSERT_EQUALS("[test.cpp:4]: (error) BOOST_FOREACH caches the end() iterator. It's undefined behavior if you modify the container inside.\n", errout.str());
6565

6666
check("void f() {\n"
6767
" set<int> data;\n"
6868
" BOOST_FOREACH(int i, data) {\n"
6969
" data.insert(123);\n"
7070
" }\n"
7171
"}");
72-
ASSERT_EQUALS("[test.cpp:4]: (error) BOOST_FOREACH caches the end() iterator. It's undefined behavior if you modify the container.\n", errout.str());
72+
ASSERT_EQUALS("[test.cpp:4]: (error) BOOST_FOREACH caches the end() iterator. It's undefined behavior if you modify the container inside.\n", errout.str());
7373

7474
check("void f() {\n"
7575
" set<int> data;\n"
7676
" BOOST_FOREACH(const int &i, data) {\n"
7777
" data.erase(123);\n"
7878
" }\n"
7979
"}");
80-
ASSERT_EQUALS("[test.cpp:4]: (error) BOOST_FOREACH caches the end() iterator. It's undefined behavior if you modify the container.\n", errout.str());
80+
ASSERT_EQUALS("[test.cpp:4]: (error) BOOST_FOREACH caches the end() iterator. It's undefined behavior if you modify the container inside.\n", errout.str());
8181

8282
// Check single line usage
8383
check("void f() {\n"
8484
" set<int> data;\n"
8585
" BOOST_FOREACH(const int &i, data)\n"
8686
" data.clear();\n"
8787
"}");
88-
ASSERT_EQUALS("[test.cpp:4]: (error) BOOST_FOREACH caches the end() iterator. It's undefined behavior if you modify the container.\n", errout.str());
88+
ASSERT_EQUALS("[test.cpp:4]: (error) BOOST_FOREACH caches the end() iterator. It's undefined behavior if you modify the container inside.\n", errout.str());
8989

9090
// Container returned as result of a function -> Be quiet
9191
check("void f() {\n"

0 commit comments

Comments
 (0)