From 0fffa1f6513b58129a108b98806209d1a0f872d0 Mon Sep 17 00:00:00 2001 From: Robert Reif Date: Fri, 12 Nov 2010 19:29:20 +0100 Subject: [PATCH] This patch fixes a bug I introduced in the previous patch. It also speeds up nested class parsing by skipping the entire class implementation using { link to jump to } rather than parsing for }. Ticket: #2172 --- lib/checkclass.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/checkclass.cpp b/lib/checkclass.cpp index 6b9362714..1d960fe82 100644 --- a/lib/checkclass.cpp +++ b/lib/checkclass.cpp @@ -744,6 +744,17 @@ void CheckClass::SpaceInfo::getVarList() continue; } + // It it a nested class or structure? + if (Token::Match(next, "class|struct|union %type% :|{")) + { + tok = tok->tokAt(2); + while (tok->str() != "{") + tok = tok->next(); + // skip implementation + tok = tok->link(); + continue; + } + // Borland C++: Ignore properties.. if (next->str() == "__property") continue;