Skip to content

Commit bb39b54

Browse files
committed
testcppcheck.cpp: mitigated passedByValue selfcheck warnings
1 parent eb958f6 commit bb39b54

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

test/testcppcheck.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ class TestCppcheck : public TestFixture {
122122
ASSERT(foundMissingIncludeSystem);
123123
}
124124

125-
static std::string exename(std::string exe)
125+
static std::string exename(const std::string& exe)
126126
{
127127
#ifdef _WIN32
128128
return exe + ".exe";
@@ -133,7 +133,8 @@ class TestCppcheck : public TestFixture {
133133

134134
CppCheck::ExecuteCmdFn getExecuteCommand(int& called) const
135135
{
136-
// NOLINTNEXTLINE(performance-unnecessary-value-param)
136+
// cppcheck-suppress passedByValue - used as callback so we need to preserve the signature
137+
// NOLINTNEXTLINE(performance-unnecessary-value-param) - used as callback so we need to preserve the signature
137138
return [&](std::string exe, std::vector<std::string> args, std::string redirect, std::string& /*output*/) -> int {
138139
++called;
139140
if (exe == exename("clang-tidy"))

0 commit comments

Comments
 (0)