Improvement to 5b8840c6b02bd648dc2b75e60145474ae12f8e67: handle also 'const struct|union' types as template parameters.
This commit is contained in:
parent
5b8840c6b0
commit
6fd6f0998b
|
@ -180,8 +180,12 @@ unsigned int TemplateSimplifier::templateParameters(const Token *tok)
|
|||
if (level == 0)
|
||||
++numberOfParameters;
|
||||
|
||||
// skip const
|
||||
if (Token::Match(tok, "const %any%"))
|
||||
tok = tok->next();
|
||||
|
||||
// skip struct/union
|
||||
if (Token::Match(tok, "struct|union|const %any%"))
|
||||
if (Token::Match(tok, "struct|union %any%"))
|
||||
tok = tok->next();
|
||||
|
||||
// skip std::
|
||||
|
|
|
@ -2291,6 +2291,7 @@ private:
|
|||
ASSERT_EQUALS(1U, templateParameters("<union C> x;"));
|
||||
ASSERT_EQUALS(1U, templateParameters("<const int> x;"));
|
||||
ASSERT_EQUALS(1U, templateParameters("<int const *> x;"));
|
||||
ASSERT_EQUALS(1U, templateParameters("<const struct C> x;"));
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue