From 0872f1291e3464b36d9f8369315263163d48c217 Mon Sep 17 00:00:00 2001 From: Robert Reif Date: Sun, 27 Feb 2011 10:13:40 -0500 Subject: [PATCH] fix a symbol database bug where a return statement could be considered a variable declaration --- lib/symboldatabase.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/symboldatabase.cpp b/lib/symboldatabase.cpp index 2c4f1eb9c..3df90dc93 100644 --- a/lib/symboldatabase.cpp +++ b/lib/symboldatabase.cpp @@ -1363,6 +1363,14 @@ void Scope::getVariableList() else if (tok->str() == "__property") continue; + // skip return + else if (tok->str() == "return") + { + while (tok->next()->str() != ";") + tok = tok->next(); + continue; + } + // Search for start of statement.. else if (tok->previous() && !Token::Match(tok->previous(), ";|{|}|public:|protected:|private:")) continue;