1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Bug 384793 - Fix implement function refactoring with var args

Change-Id: I420a6a8197ff343a5719d8cc3d85eeb9ea889dfa
Signed-off-by: Marco Stornelli <marco.stornelli@gmail.com>
This commit is contained in:
Marco Stornelli 2020-01-19 13:02:13 +01:00
parent c25c9672dc
commit c309923d71
2 changed files with 14 additions and 0 deletions

View file

@ -864,4 +864,17 @@ public class ImplementMethodRefactoringTest extends RefactoringTestBase {
expectedFinalInfos = 1;
assertRefactoringSuccess();
}
//A.h
//
///*$*/int PrintfToStdStr(const char *pszFmt, ...);/*$$*/
//
//A.cpp
//====================
//int PrintfToStdStr(const char *pszFmt, ...) {
//}
public void testFreeFunctionWithVarArgs_Bug384793() throws Exception {
assertRefactoringSuccess();
}
}

View file

@ -326,6 +326,7 @@ public class ImplementMethodRefactoring extends CRefactoring {
createdMethodDeclarator = nodeFactory.newFunctionDeclarator(qName);
createdMethodDeclarator.setConst(functionDeclarator.isConst());
createdMethodDeclarator.setRefQualifier(functionDeclarator.getRefQualifier());
createdMethodDeclarator.setVarArgs(functionDeclarator.takesVarArgs());
for (IASTPointerOperator pop : functionDeclarator.getPointerOperators()) {
createdMethodDeclarator.addPointerOperator(pop.copy(CopyStyle.withLocations));
}