From 85c02df56cc0c1c5ef265fb9afce5ca49039af03 Mon Sep 17 00:00:00 2001 From: Alexander Mai Date: Tue, 18 Nov 2014 19:36:47 +0100 Subject: [PATCH] Fix compiler warning. run astyle --- lib/checkstl.cpp | 4 ++-- test/testsymboldatabase.cpp | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/checkstl.cpp b/lib/checkstl.cpp index a7ab263b4..77b09272e 100644 --- a/lib/checkstl.cpp +++ b/lib/checkstl.cpp @@ -851,7 +851,7 @@ void CheckStl::if_find() else if (Token::Match(decl, "%type% >")) { decl = decl->tokAt(2); if (warning && (Token::Match(decl, "* &| %varid%", varid) || - Token::Match(decl, "&| %varid% [ ]| %any% ]| ", varid))) + Token::Match(decl, "&| %varid% [ ]| %any% ]| ", varid))) if_findError(tok, false); } @@ -862,7 +862,7 @@ void CheckStl::if_find() else if (performance && var->isStlStringType()) { decl = decl->next(); if (Token::Match(decl, "* &| %varid%", varid) || - Token::Match(decl, "&| %varid% [ ]| %any% ]| ", varid)) + Token::Match(decl, "&| %varid% [ ]| %any% ]| ", varid)) if_findError(tok, true); } } diff --git a/test/testsymboldatabase.cpp b/test/testsymboldatabase.cpp index 21ba08440..a4100f9c6 100644 --- a/test/testsymboldatabase.cpp +++ b/test/testsymboldatabase.cpp @@ -2358,6 +2358,9 @@ private: "void CheckMemoryLeakInFunction::getcode(const Token *tok ) {\n" " addtoken(&rettail, tok);\n" "}"); + const Token *f = Token::findsimplematch(tokenizer.tokens(), "void addtoken ( Token * *"); + ASSERT_EQUALS(true, db && f); + ASSERT_EQUALS(true, db && f && f->function()); }