File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -7,8 +7,8 @@ namespace CppSharp.Passes
77 /// <summary>
88 /// This pass generates internal classes that implement abstract classes.
99 /// When the return type of a function is abstract, these internal
10- /// classes provide since the real type cannot be resolved while binding
11- /// an allocatable class that supports proper polymorphism.
10+ /// classes are used instead since the real type cannot be resolved
11+ /// while binding an allocatable class that supports proper polymorphism.
1212 /// </summary>
1313 public class GenerateAbstractImplementationsPass : TranslationUnitPass
1414 {
@@ -57,7 +57,7 @@ public override bool VisitClassDecl(Class @class)
5757 if ( @class . CompleteDeclaration != null )
5858 return VisitClassDecl ( @class . CompleteDeclaration as Class ) ;
5959
60- if ( @class . IsAbstract )
60+ if ( @class . IsAbstract && ! @class . IsTemplate )
6161 {
6262 foreach ( var ctor in from ctor in @class . Constructors
6363 where ctor . Access == AccessSpecifier . Public
Original file line number Diff line number Diff line change @@ -1537,3 +1537,15 @@ struct DerivedCovariant: public BaseCovariant {
15371537 return PtrCovariant (new DerivedCovariant ());
15381538 }
15391539};
1540+
1541+ // Issue: https://github.com/mono/CppSharp/issues/1268
1542+ template <typename T>
1543+ class AbstractClassTemplate {
1544+ public:
1545+ virtual void func () = 0;
1546+ };
1547+
1548+ class DerivedClass : public AbstractClassTemplate <int > {
1549+ public:
1550+ void func () override {}
1551+ };
You can’t perform that action at this time.
0 commit comments