diff --git a/src/Generator/Passes/GenerateAbstractImplementationsPass.cs b/src/Generator/Passes/GenerateAbstractImplementationsPass.cs index 4953047d..6ae567b3 100644 --- a/src/Generator/Passes/GenerateAbstractImplementationsPass.cs +++ b/src/Generator/Passes/GenerateAbstractImplementationsPass.cs @@ -7,8 +7,8 @@ namespace CppSharp.Passes /// /// This pass generates internal classes that implement abstract classes. /// When the return type of a function is abstract, these internal - /// classes provide since the real type cannot be resolved while binding - /// an allocatable class that supports proper polymorphism. + /// classes are used instead since the real type cannot be resolved + /// while binding an allocatable class that supports proper polymorphism. /// public class GenerateAbstractImplementationsPass : TranslationUnitPass { @@ -57,7 +57,7 @@ namespace CppSharp.Passes if (@class.CompleteDeclaration != null) return VisitClassDecl(@class.CompleteDeclaration as Class); - if (@class.IsAbstract) + if (@class.IsAbstract && !@class.IsTemplate) { foreach (var ctor in from ctor in @class.Constructors where ctor.Access == AccessSpecifier.Public diff --git a/tests/Common/Common.h b/tests/Common/Common.h index 8cf28fab..bee5e26d 100644 --- a/tests/Common/Common.h +++ b/tests/Common/Common.h @@ -1537,3 +1537,15 @@ struct DerivedCovariant: public BaseCovariant { return PtrCovariant(new DerivedCovariant()); } }; + +// Issue: https://github.com/mono/CppSharp/issues/1268 +template +class AbstractClassTemplate { + public: + virtual void func() = 0; +}; + +class DerivedClass: public AbstractClassTemplate { + public: + void func() override {} +};