Fix unmunch for template arguments

Fixes #147.
This commit is contained in:
Jonathan Müller 2022-10-13 09:20:33 +02:00
commit 34e7bb4bf4
10 changed files with 67 additions and 36 deletions

View file

@ -73,6 +73,13 @@ struct e
template <>
class a<int> {};
// full specialization with munch
/// template<>
/// class a<a<int>>{
/// };
template <>
class a<a<int>> {};
/// template<>
/// struct b<0,int>{
/// };
@ -245,7 +252,10 @@ template class a<int>;
if (templ.is_full_specialization())
{
check_template_parameters(templ, {});
REQUIRE(templ.unexposed_arguments().as_string() == "int");
auto args = templ.unexposed_arguments().as_string();
if (args != "int" && args != "a<int>")
FAIL("invalid args for specialization");
}
else
{
@ -273,5 +283,5 @@ template class a<int>;
else
REQUIRE(false);
});
REQUIRE(count == 6u);
REQUIRE(count == 7u);
}