struct A { int a = 0; void f() { a = 1; } template <typename T, typename... Args> auto call(const Args &... args) -> T { a = 2; return T{}; } }; struct B : public A { void test() { f(); call<int>(1, 2, 3); } }; int main() { B b; b.test(); }
cppcheck: commit 62702a6 built with: make MATCHCOMPILER=yes FILESDIR=/usr/share/cppcheck HAVE_RULES=yes
$ cppcheck --enable=all main.cpp Checking main.cpp ... main.cpp:4:0: style: The function 'call' is never used. [unusedFunction] ^
Thanks! I have created ticket https://trac.cppcheck.net/ticket/9805
Log in to post a comment.
cppcheck: commit 62702a6
built with: make MATCHCOMPILER=yes FILESDIR=/usr/share/cppcheck HAVE_RULES=yes
Last edit: Andreas Grob 2020-07-15
Thanks! I have created ticket https://trac.cppcheck.net/ticket/9805