Browse Source

Fixed the generated code when a template has a base type.

Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
cpp_module_crash
Dimitar Dobrev 9 years ago
parent
commit
5f679576e0
  1. 3
      src/Generator/Generators/CSharp/CSharpTextTemplate.cs
  2. 2
      tests/CSharp/CSharpTemplates.h

3
src/Generator/Generators/CSharp/CSharpTextTemplate.cs

@ -655,7 +655,8 @@ namespace CppSharp.Generators.CSharp @@ -655,7 +655,8 @@ namespace CppSharp.Generators.CSharp
{
Write("public ");
if (@class != null && @class.NeedsBase && !@class.BaseClass.IsInterface && !@class.IsDependent)
if (@class != null && @class.NeedsBase && !@class.BaseClass.IsInterface &&
!(@class is ClassTemplateSpecialization))
Write("new ");
var templateSpecialization = @class as ClassTemplateSpecialization;

2
tests/CSharp/CSharpTemplates.h

@ -9,7 +9,7 @@ class DLL_API T2 @@ -9,7 +9,7 @@ class DLL_API T2
};
template <typename T>
class DLL_API IndependentFields
class DLL_API IndependentFields : public T1
{
private:
int field;

Loading…
Cancel
Save