From fd4b02e538ba64e45731b86bef549890318c5a77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Wed, 5 Nov 2008 07:25:28 +0000 Subject: [PATCH] CheckClass: Removed false positive "unused private function" for typedef (Bug 2220326) --- CheckClass.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/CheckClass.cpp b/CheckClass.cpp index a50c83ef8..0c6ea934e 100644 --- a/CheckClass.cpp +++ b/CheckClass.cpp @@ -1,4 +1,4 @@ -/* +/* * c++check - c/c++ syntax checking * Copyright (C) 2007 Daniel Marjamäki * @@ -451,9 +451,11 @@ void CheckUnusedPrivateFunctions() priv = false; else if (priv && indent_level == 1) { - if (isalpha(tok->str[0]) && - tok->next->str[0]=='(' && - strcmp(tok->str,classname) != 0) + if ( Match(tok, "typedef %type% (") ) + tok = gettok(tok, 2); + + if (Match(tok, "%var% (") && + !Match(tok,classname)) { FuncList.push_back(tok->str); }