hmm I fail to reproduce. I copied your example code to fp1.cpp and used this command:
$../.cppcheck/cppcheck-2.13.0--enable=all--library=googletestfp1.cppCheckingfp1.cpp...fp1.cpp:20:0:style:Thefunction'__DiagnosticsAdapterTest_ReportScoped'isneverused.[unusedFunction]TEST_F(DiagnosticsAdapterTest,ReportScoped)^nofile:0:0:information:Activecheckers:161/592(use--checkers-report=<filename> to see details) [checkersReport]
Should I tweak my command somehow?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I think we have a false positive, but I am not 100% sure.
We are compiling for C++20
CppCheck notification
This is a simplification of the code, but I hope it provides enough context.
Last edit: Rob Deckers 2024-03-28
hmm I fail to reproduce. I copied your example code to fp1.cpp and used this command:
Should I tweak my command somehow?