We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4644e2a commit aacd9b9Copy full SHA for aacd9b9
2 files changed
lib/templatesimplifier.cpp
@@ -305,7 +305,7 @@ unsigned int TemplateSimplifier::templateParameters(const Token *tok)
305
// ,/>
306
while (Token::Match(tok, ">|>>")) {
307
if (level == 0)
308
- return numberOfParameters;
+ return ((tok->str() == ">") ? numberOfParameters : 0);
309
--level;
310
if (tok->str() == ">>") {
311
test/testsimplifytemplate.cpp
@@ -1150,6 +1150,7 @@ class TestSimplifyTemplate : public TestFixture {
1150
ASSERT_EQUALS(1U, templateParameters("<const int> x;"));
1151
ASSERT_EQUALS(1U, templateParameters("<int const *> x;"));
1152
ASSERT_EQUALS(1U, templateParameters("<const struct C> x;"));
1153
+ ASSERT_EQUALS(0U, templateParameters("<len>>x;"));
1154
}
1155
1156
void templateParameters1() {
0 commit comments