diff --git a/lib/checkstl.cpp b/lib/checkstl.cpp index 6af7b11c20d..659f5e08a84 100644 --- a/lib/checkstl.cpp +++ b/lib/checkstl.cpp @@ -1998,7 +1998,7 @@ void CheckStl::useStlAlgorithm() algo = "std::copy"; else algo = "std::transform"; - useStlAlgorithmError(assignTok, algo); + useStlAlgorithmError(memberCallTok, algo); } continue; } diff --git a/test/teststl.cpp b/test/teststl.cpp index 9ef1c2cc2c7..1410a1e790b 100644 --- a/test/teststl.cpp +++ b/test/teststl.cpp @@ -3324,7 +3324,7 @@ class TestStl : public TestFixture { " c.push_back(x);\n" "}\n", true); - ASSERT_EQUALS("(style) Consider using std::copy algorithm instead of a raw loop.\n", errout.str()); + ASSERT_EQUALS("[test.cpp:4]: (style) Consider using std::copy algorithm instead of a raw loop.\n", errout.str()); check("void foo() {\n" " std::vector c;\n" @@ -3332,7 +3332,7 @@ class TestStl : public TestFixture { " c.push_back(f(x));\n" "}\n", true); - ASSERT_EQUALS("(style) Consider using std::transform algorithm instead of a raw loop.\n", errout.str()); + ASSERT_EQUALS("[test.cpp:4]: (style) Consider using std::transform algorithm instead of a raw loop.\n", errout.str()); check("void foo() {\n" " std::vector c;\n" @@ -3340,7 +3340,7 @@ class TestStl : public TestFixture { " c.push_back(x + 1);\n" "}\n", true); - ASSERT_EQUALS("(style) Consider using std::transform algorithm instead of a raw loop.\n", errout.str()); + ASSERT_EQUALS("[test.cpp:4]: (style) Consider using std::transform algorithm instead of a raw loop.\n", errout.str()); check("void foo() {\n" " std::vector c;\n" @@ -3348,7 +3348,7 @@ class TestStl : public TestFixture { " c.push_front(x);\n" "}\n", true); - ASSERT_EQUALS("(style) Consider using std::copy algorithm instead of a raw loop.\n", errout.str()); + ASSERT_EQUALS("[test.cpp:4]: (style) Consider using std::copy algorithm instead of a raw loop.\n", errout.str()); check("void foo() {\n" " std::vector c;\n" @@ -3356,7 +3356,7 @@ class TestStl : public TestFixture { " c.push_front(f(x));\n" "}\n", true); - ASSERT_EQUALS("(style) Consider using std::transform algorithm instead of a raw loop.\n", errout.str()); + ASSERT_EQUALS("[test.cpp:4]: (style) Consider using std::transform algorithm instead of a raw loop.\n", errout.str()); check("void foo() {\n" " std::vector c;\n" @@ -3364,7 +3364,7 @@ class TestStl : public TestFixture { " c.push_front(x + 1);\n" "}\n", true); - ASSERT_EQUALS("(style) Consider using std::transform algorithm instead of a raw loop.\n", errout.str()); + ASSERT_EQUALS("[test.cpp:4]: (style) Consider using std::transform algorithm instead of a raw loop.\n", errout.str()); check("void foo() {\n" " std::vector c;\n"