mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-28 19:35:36 +02:00
Bug 333389: Variadic function templates.
This commit is contained in:
parent
4276eda033
commit
4c700d7e5f
2 changed files with 19 additions and 5 deletions
|
@ -5266,4 +5266,16 @@ public class AST2TemplateTests extends AST2BaseTest {
|
||||||
public void testFunctionCallOnDependentName_Bug337686() throws Exception {
|
public void testFunctionCallOnDependentName_Bug337686() throws Exception {
|
||||||
parseAndCheckBindings();
|
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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -946,11 +946,13 @@ public class CPPTemplates {
|
||||||
}
|
}
|
||||||
if (result != types) {
|
if (result != types) {
|
||||||
result[j++]= newType;
|
result[j++]= newType;
|
||||||
} else if (newType != origType) {
|
} else {
|
||||||
|
if (newType != origType) {
|
||||||
result = new IType[types.length];
|
result = new IType[types.length];
|
||||||
j= i;
|
|
||||||
System.arraycopy(types, 0, result, 0, i);
|
System.arraycopy(types, 0, result, 0, i);
|
||||||
result[j++]= newType;
|
result[j]= newType;
|
||||||
|
}
|
||||||
|
j++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
|
|
Loading…
Add table
Reference in a new issue