1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-01 14:15:23 +02:00

Bug 333389: Variadic function templates.

This commit is contained in:
Markus Schorn 2011-03-02 10:54:21 +00:00
parent 4276eda033
commit 4c700d7e5f
2 changed files with 19 additions and 5 deletions

View file

@ -5266,4 +5266,16 @@ public class AST2TemplateTests extends AST2BaseTest {
public void testFunctionCallOnDependentName_Bug337686() throws Exception {
parseAndCheckBindings();
}
// struct S {};
// template <typename... Args> void h(S s, Args... args) {}
// void g() {
// S s;
// h(s);
// h(s, 1); Variadicsd f
// h(s, 1, 2);
// }
public void testVariadicFunctionTemplate_Bug333389() throws Exception {
parseAndCheckBindings();
}
}

View file

@ -946,11 +946,13 @@ public class CPPTemplates {
}
if (result != types) {
result[j++]= newType;
} else if (newType != origType) {
result = new IType[types.length];
j= i;
System.arraycopy(types, 0, result, 0, i);
result[j++]= newType;
} else {
if (newType != origType) {
result = new IType[types.length];
System.arraycopy(types, 0, result, 0, i);
result[j]= newType;
}
j++;
}
}
return result;