parent
ce780177b2
commit
03026c7304
|
@ -454,8 +454,9 @@ unsigned int TemplateSimplifier::templateParameters(const Token *tok)
|
|||
if (level == 1)
|
||||
return numberOfParameters;
|
||||
level -= 2;
|
||||
} else if (tok->str() == "," && level == 0) {
|
||||
++numberOfParameters;
|
||||
} else if (tok->str() == ",") {
|
||||
if (level == 0)
|
||||
++numberOfParameters;
|
||||
tok = tok->next();
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -5318,6 +5318,7 @@ private:
|
|||
ASSERT_EQUALS(3U, templateParameters("template <class T, class... Args, class Tup = std::tuple<Args&&...>> void f() {}"));
|
||||
ASSERT_EQUALS(3U, templateParameters("template <class T, class... Args, class Tup = std::tuple<Args*...>> void f() {}"));
|
||||
ASSERT_EQUALS(1U, templateParameters("S<4 < sizeof(uintptr_t)> x;"));
|
||||
ASSERT_EQUALS(2U, templateParameters("template <typename... Ts, typename = std::enable_if_t<std::is_same<Ts..., int>::value>> void g() {}")); // #11915
|
||||
}
|
||||
|
||||
// Helper function to unit test TemplateSimplifier::getTemplateNamePosition
|
||||
|
|
Loading…
Reference in New Issue