mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Bug 294730: Instantiating templates with non-type template parameter packs.
This commit is contained in:
parent
c9bb347592
commit
2cf1353146
2 changed files with 14 additions and 0 deletions
|
@ -4441,6 +4441,17 @@ public class AST2TemplateTests extends AST2BaseTest {
|
|||
assertFalse(tp.isParameterPack());
|
||||
}
|
||||
|
||||
// template <int ...I> struct CTx {};
|
||||
// void test() {
|
||||
// CTx<> a;
|
||||
// CTx<1> b;
|
||||
// CTx<1,2> c;
|
||||
// }
|
||||
public void testNonTypeTemplateParameterPack_280909() throws Exception {
|
||||
final String code= getAboveComment();
|
||||
parseAndCheckBindings(code, ParserLanguage.CPP);
|
||||
}
|
||||
|
||||
// template<typename... Types>
|
||||
// struct count { static const int value = sizeof...(Types);
|
||||
// };
|
||||
|
|
|
@ -1889,6 +1889,9 @@ public class CPPTemplates {
|
|||
IType argType= arg.getTypeOfNonTypeValue();
|
||||
try {
|
||||
IType pType = ((ICPPTemplateNonTypeParameter) param).getType();
|
||||
if (pType instanceof ICPPParameterPackType) {
|
||||
pType= ((ICPPParameterPackType) pType).getType();
|
||||
}
|
||||
if (map != null && pType != null) {
|
||||
pType= instantiateType(pType, map, -1, null);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue