[ClavaAst] Removes initializer list when adding constructor to class
From automatically created declaration;
@@ -141,6 +141,11 @@ public class CXXRecordDecl extends RecordDecl {
if (method.hasBody()) {
methodDeclaration = (CXXMethodDecl) method.deepCopy();
methodDeclaration.getBody().get().detach();
+
+ // If declaration is a constructor, remove initializer list, remove it
+ if (methodDeclaration instanceof CXXConstructorDecl) {
+ methodDeclaration.set(CXXConstructorDecl.CONSTRUCTOR_INITS, new ArrayList<>());
+ }
}
var methodSig = methodDeclaration.getSignature();
