Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions lib/tokenize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7002,6 +7002,7 @@ Token *Tokenizer::simplifyAddBracesPair(Token *tok, bool commandWithCondition)

tokAfterCondition->previous()->insertToken("{");
Token * tokOpenBrace=tokAfterCondition->previous();
tokOpenBrace->column(tokAfterCondition->column());

tokEnd->insertToken("}");
Token * tokCloseBrace=tokEnd->next();
Expand Down
8 changes: 4 additions & 4 deletions test/teststl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ class TestStl : public TestFixture {
" return i;\n"
" return 0;\n"
"}\n");
ASSERT_EQUALS("[test.cpp:8:0]: style: Consider using std::find_if algorithm instead of a raw loop. [useStlAlgorithm]\n", errout_str());
ASSERT_EQUALS("[test.cpp:8:13]: style: Consider using std::find_if algorithm instead of a raw loop. [useStlAlgorithm]\n", errout_str());

checkNormal("bool g();\n"
"int f(int x) {\n"
Expand All @@ -626,7 +626,7 @@ class TestStl : public TestFixture {
" return i;\n"
" return 0;\n"
"}\n");
ASSERT_EQUALS("[test.cpp:8:0]: style: Consider using std::find_if algorithm instead of a raw loop. [useStlAlgorithm]\n", errout_str());
ASSERT_EQUALS("[test.cpp:8:13]: style: Consider using std::find_if algorithm instead of a raw loop. [useStlAlgorithm]\n", errout_str());

checkNormal("bool g();\n"
"void f(int x) {\n"
Expand Down Expand Up @@ -5260,7 +5260,7 @@ class TestStl : public TestFixture {
" return s.erase(it);\n"
" return s.end();\n"
"}\n");
ASSERT_EQUALS("[test.cpp:3:0]: (style) Consider using std::find_if algorithm instead of a raw loop. [useStlAlgorithm]\n", errout_str());
ASSERT_EQUALS("[test.cpp:3:9]: (style) Consider using std::find_if algorithm instead of a raw loop. [useStlAlgorithm]\n", errout_str());

// #11381
check("int f(std::map<int, int>& map) {\n"
Expand Down Expand Up @@ -5953,7 +5953,7 @@ class TestStl : public TestFixture {
" v1.erase(it1);\n"
" }\n"
"}\n");
ASSERT_EQUALS("[test.cpp:9:0]: (style) Consider using std::find_if algorithm instead of a raw loop. [useStlAlgorithm]\n", errout_str());
ASSERT_EQUALS("[test.cpp:9:17]: (style) Consider using std::find_if algorithm instead of a raw loop. [useStlAlgorithm]\n", errout_str());

check("bool f(const std::set<std::string>& set, const std::string& f) {\n" // #11595
" for (const std::string& s : set) {\n"
Expand Down
Loading