Skip to content

Commit 1020e18

Browse files
committed
Only implement abstract classes in C++ for ctors/dtors
Signed-off-by: Dimitar Dobrev <[email protected]>
1 parent e24277e commit 1020e18

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/Generator/Passes/SymbolsCodeGenerator.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ public override bool VisitMethodDecl(Method method)
5959
}
6060

6161
Class @class = (Class) method.Namespace;
62-
bool needSubclass = method.Access == AccessSpecifier.Protected ||
63-
@class.IsAbstract;
62+
bool needSubclass = (method.Access == AccessSpecifier.Protected ||
63+
@class.IsAbstract) && (method.IsConstructor || method.IsDestructor);
6464
string wrapper = GetWrapper(method);
6565
int i = 0;
6666
foreach (var param in method.Parameters.Where(

tests/CSharp/CSharp.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1376,6 +1376,7 @@ class DLL_API SimpleInterface
13761376
virtual int size() const = 0;
13771377
virtual int capacity() const = 0;
13781378
virtual void* get(int n) = 0;
1379+
void hasParameterOnEmtptyCtor(int i) {}
13791380
};
13801381

13811382
class DLL_API InterfaceTester

0 commit comments

Comments
 (0)