1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-21 21:52:10 +02:00

Bug 540741 - Parameter pack in argument of alias template instance that's not present in the target type

Change-Id: Ic5a5d0b25d88bac4074cb78aec17a1311a51d75d
This commit is contained in:
Nathan Ridge 2018-11-20 01:44:08 -05:00
parent afc2bbaa62
commit 2f678054ff
2 changed files with 29 additions and 0 deletions

View file

@ -11075,4 +11075,24 @@ public class AST2TemplateTests extends AST2CPPTestBase {
BindingAssertionHelper bh = new AST2AssertionHelper(getAboveComment(), CPP);
bh.assertProblem("B<A>", 4);
}
// struct my_type {};
//
// template <class>
// using my_type_alias = my_type;
//
// template <class... Ts>
// struct foo {
// template <class... Vs>
// static int select(my_type_alias<Ts>..., Vs...);
//
// using type = decltype(select(Ts()...));
// };
//
// template <class> struct trigger{};
//
// using A = trigger<foo<my_type>::type>;
public void testParameterPackInAliasTemplateArgs_540741() throws Exception {
parseAndCheckBindings();
}
}

View file

@ -1238,6 +1238,15 @@ public class CPPTemplates {
}
if (type instanceof ITypeContainer) {
if (type instanceof ICPPAliasTemplateInstance) {
ICPPTemplateArgument[] args = ((ICPPAliasTemplateInstance) type).getTemplateArguments();
for (ICPPTemplateArgument arg : args) {
r = combinePackSize(r, determinePackSize(arg, tpMap));
if (r < 0) {
return r;
}
}
}
final ITypeContainer typeContainer = (ITypeContainer) type;
r = combinePackSize(r, determinePackSize(typeContainer.getType(), tpMap));
}