I get a possible false positive warning when using trailing return type while overriding a virtual function.
warning: Unused private function: 'Test::PrivateTest' [unusedPrivateFunction]
#ifndef TEST_H #define TEST_H class BaseTest { public: virtual auto Testing() -> void = 0; }; class Test final : public BaseTest { private: auto PrivateTest() -> void; public: auto Testing() -> void override; }; #endif // TEST_H auto Test::PrivateTest() -> void { return; } auto Test::Testing() -> void { PrivateTest(); }
When I don't use trailing return type in the public function definition, I don't get any warning. Also no warning when removing the override.
Thanks for reporting, ticket is here: https://trac.cppcheck.net/ticket/12619
Log in to post a comment.
I get a possible false positive warning when using trailing return type while overriding a virtual function.
When I don't use trailing return type in the public function definition, I don't get any warning.
Also no warning when removing the override.
Thanks for reporting, ticket is here: https://trac.cppcheck.net/ticket/12619