Skip to content

Fix infer issues - PULSE_CONST_REFABLE #90

@eljonny

Description

@eljonny
include/internal/TestCPPTestCase.h:345: error: Const Refable Parameter
  Function parameter `func` is passed by-value but not modified inside this function, resulting in a potential unnecessary copy at the function's callsites. Change the type of the parameter to `const &`.
  343.          */
  344.         template<typename F, typename ...Args>
  345.         static nanoseconds duration (F func, Args&&... args)
               ^
  346.         {
  347.             auto start = system_clock::now();

src/TestCPPAssertions.cpp:136: error: Const Refable Parameter
  Function parameter `shouldNotThrow` is passed by-value but not modified inside this function, resulting in a potential unnecessary copy at the function's callsites. Change the type of the parameter to `const &`.
  134.     }
  135.
  136.     void Assertions::assertNoThrows (
           ^
  137.             function<void()> shouldNotThrow,
  138.             const string& failureMessage

Fixing related CPPCheck issue #8 (reopened to fix one issue present here specifically) via #101 (specifically commit c4c983b) resolved the TestCPPTestCase.cpp:304 issue with TestCPPTestCase::logTestFailure.

Metadata

Metadata

Assignees

Labels

static-analysisAn issue related to a static analysis result

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions