From feb065abc8e3e13d498ded80f1a6fc1e481e897c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Fri, 30 Oct 2009 15:00:13 +0100 Subject: [PATCH] Fixed #867 (unused member function warning) --- lib/checkunusedfunctions.cpp | 2 +- test/testunusedfunctions.cpp | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/checkunusedfunctions.cpp b/lib/checkunusedfunctions.cpp index 0149c6a59..8e6ee9e2e 100644 --- a/lib/checkunusedfunctions.cpp +++ b/lib/checkunusedfunctions.cpp @@ -110,7 +110,7 @@ void CheckUnusedFunctions::parseTokens(const Tokenizer &tokenizer) else if (Token::Match(tok, "[;{}.,()[=+-/&|!?:] %var% [(),;:}]")) funcname = tok->next(); - else if (Token::Match(tok, "[(,] & %var% :: %var% [,)]")) + else if (Token::Match(tok, "[=(,] & %var% :: %var% [,);]")) funcname = tok->tokAt(4); else diff --git a/test/testunusedfunctions.cpp b/test/testunusedfunctions.cpp index 0f881d02a..1f8c51966 100644 --- a/test/testunusedfunctions.cpp +++ b/test/testunusedfunctions.cpp @@ -119,6 +119,17 @@ private: " return 0\n" "}\n"); ASSERT_EQUALS("", errout.str()); + + check("namespace abc {\n" + "void foo() { }\n" + "};\n" + "\n" + "int main()\n" + "{\n" + " f = &abc::foo;\n" + " return 0\n" + "}\n"); + ASSERT_EQUALS("", errout.str()); } void template1()