From d6d0d681c9604ebc39be171e60c437c579d7285f Mon Sep 17 00:00:00 2001 From: Dimitar Dobrev Date: Tue, 19 Aug 2014 01:41:53 +0300 Subject: [PATCH] Fixed a compilation error when wrapping abstract destructors. Signed-off-by: Dimitar Dobrev --- src/Generator/Generators/CSharp/CSharpTextTemplate.cs | 2 +- tests/Basic/Basic.h | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Generator/Generators/CSharp/CSharpTextTemplate.cs b/src/Generator/Generators/CSharp/CSharpTextTemplate.cs index 48ecca97..01f1d708 100644 --- a/src/Generator/Generators/CSharp/CSharpTextTemplate.cs +++ b/src/Generator/Generators/CSharp/CSharpTextTemplate.cs @@ -1848,7 +1848,7 @@ namespace CppSharp.Generators.CSharp var dtor = @class.Methods.FirstOrDefault(method => method.IsDestructor); if (dtor != null) { - if (dtor.Access != AccessSpecifier.Private && @class.HasNonTrivialDestructor) + if (dtor.Access != AccessSpecifier.Private && @class.HasNonTrivialDestructor && !dtor.IsPure) { NativeLibrary library; if (!Options.CheckSymbols || diff --git a/tests/Basic/Basic.h b/tests/Basic/Basic.h index 92272ce2..43f1e6d8 100644 --- a/tests/Basic/Basic.h +++ b/tests/Basic/Basic.h @@ -531,3 +531,9 @@ template struct DependentType { DependentType(typename T::Dependent* t) { } }; + +class PureDtor +{ +public: + virtual ~PureDtor() = 0; +};