From aa2a7117ace8a396c235d42cb15cfa675de68159 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joa=CC=83o=20Matos?= Date: Wed, 1 Apr 2020 12:54:12 +0100 Subject: [PATCH] Fix generation of C++ constructor for abstract classes. --- src/Generator/Generators/C/CppSources.cs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/Generator/Generators/C/CppSources.cs b/src/Generator/Generators/C/CppSources.cs index a6641beb..c959bfc4 100644 --- a/src/Generator/Generators/C/CppSources.cs +++ b/src/Generator/Generators/C/CppSources.cs @@ -369,12 +369,15 @@ namespace CppSharp.Generators.Cpp if (@class.IsRefType) { - if (method.IsConstructor && !@class.IsAbstract) + if (method.IsConstructor) { - var @params = GenerateFunctionParamsMarshal(method.Parameters, method); - Write($"{Helpers.InstanceIdentifier} = new ::{method.Namespace.QualifiedOriginalName}("); - GenerateFunctionParams(@params); - WriteLine(");"); + if (!@class.IsAbstract) + { + var @params = GenerateFunctionParamsMarshal(method.Parameters, method); + Write($"{Helpers.InstanceIdentifier} = new ::{method.Namespace.QualifiedOriginalName}("); + GenerateFunctionParams(@params); + WriteLine(");"); + } } else {