diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index 6305e0f021a..48472e0605e 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -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(); diff --git a/test/teststl.cpp b/test/teststl.cpp index 51fab0e6021..2060a5cfd2b 100644 --- a/test/teststl.cpp +++ b/test/teststl.cpp @@ -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" @@ -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" @@ -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& map) {\n" @@ -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& set, const std::string& f) {\n" // #11595 " for (const std::string& s : set) {\n"