From d110d715ba6b05a36b1621e4e2568d8f8180b388 Mon Sep 17 00:00:00 2001 From: PKEuS Date: Fri, 9 Jan 2015 22:03:43 +0100 Subject: [PATCH] Refactorization: Use Token::link() when stringifying template argument list in symboldatabase.cpp --- lib/symboldatabase.cpp | 23 +++++------------------ 1 file changed, 5 insertions(+), 18 deletions(-) diff --git a/lib/symboldatabase.cpp b/lib/symboldatabase.cpp index 90ad1eb5c..470dca2b8 100644 --- a/lib/symboldatabase.cpp +++ b/lib/symboldatabase.cpp @@ -1865,30 +1865,17 @@ const Token *Type::initBaseInfo(const Token *tok, const Token *tok1) base.name = tok2->str(); + tok2 = tok2->next(); // add unhandled templates - if (tok2->next() && tok2->next()->str() == "<") { - tok2 = tok2->next(); - base.name += tok2->str(); - - int level1 = 1; - while (tok2->next()) { - base.name += tok2->next()->str(); - - if (tok2->next()->str() == ">") { - level1--; - if (level1 == 0) - break; - } else if (tok2->next()->str() == "<") - level1++; - - tok2 = tok2->next(); + if (tok2 && tok2->link() && tok2->str() == "<") { + for (const Token* const end = tok2->link()->next(); tok2 != end; tok2 = tok2->next()) { + base.name += tok2->str(); } } // save pattern for base class name derivedFrom.push_back(base); - } - if (tok2) // see #4806 + } else tok2 = tok2->next(); }