diff --git a/lib/tokenize.cpp b/lib/tokenize.cpp index 2c2e6d5e1..ad2e81738 100644 --- a/lib/tokenize.cpp +++ b/lib/tokenize.cpp @@ -2791,8 +2791,8 @@ void Tokenizer::simplifyTemplatesUseDefaultArgumentValues(const std::list &used, - const Token *tok, +void Tokenizer::simplifyTemplatesInstantiate(const Token *tok, + std::list &used, std::set &expandedtemplates) { // this variable is not used at the moment. the intention was to @@ -3157,9 +3157,9 @@ void Tokenizer::simplifyTemplates() //while (!done) { done = true; - for (std::list::iterator iter1 = templates.begin(); iter1 != templates.end(); ++iter1) + for (std::list::const_iterator iter1 = templates.begin(); iter1 != templates.end(); ++iter1) { - simplifyTemplatesInstantiate(used, *iter1, expandedtemplates); + simplifyTemplatesInstantiate(*iter1, used, expandedtemplates); } } diff --git a/lib/tokenize.h b/lib/tokenize.h index 579c233bd..cc076e120 100644 --- a/lib/tokenize.h +++ b/lib/tokenize.h @@ -425,9 +425,13 @@ public: /** * Simplify templates : expand all instantiatiations for a template + * @todo It seems that inner templates should be instantiated recursively + * @param tok token where the template declaration begins + * @param used a list of template usages (not necessarily just for this template) + * @param expandedtemplates all templates that has been expanded so far. The full names are stored. */ - void simplifyTemplatesInstantiate(std::list &used, - const Token *tok, + void simplifyTemplatesInstantiate(const Token *tok, + std::list &used, std::set &expandedtemplates); /**