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
7
7
/// <summary>
8
8
/// This pass generates internal classes that implement abstract classes.
9
9
/// 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.
12
12
/// </summary>
13
13
public class GenerateAbstractImplementationsPass : TranslationUnitPass
14
14
{
@@ -57,7 +57,7 @@ public override bool VisitClassDecl(Class @class)
57
57
if ( @class . CompleteDeclaration != null )
58
58
return VisitClassDecl ( @class . CompleteDeclaration as Class ) ;
59
59
60
- if ( @class . IsAbstract )
60
+ if ( @class . IsAbstract && ! @class . IsTemplate )
61
61
{
62
62
foreach ( var ctor in from ctor in @class . Constructors
63
63
where ctor . Access == AccessSpecifier . Public
Original file line number Diff line number Diff line change @@ -1537,3 +1537,15 @@ struct DerivedCovariant: public BaseCovariant {
1537
1537
return PtrCovariant (new DerivedCovariant ());
1538
1538
}
1539
1539
};
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