Browse Source

Removed extensions for internal template specialisations.

Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
pull/1015/head
Dimitar Dobrev 8 years ago
parent
commit
d996d8a4d0
  1. 3
      src/Generator/Passes/SpecializationMethodsWithDependentPointersPass.cs
  2. 14
      tests/CSharp/CSharpTemplates.h

3
src/Generator/Passes/SpecializationMethodsWithDependentPointersPass.cs

@ -57,7 +57,8 @@ namespace CppSharp.Passes @@ -57,7 +57,8 @@ namespace CppSharp.Passes
public override bool VisitClassDecl(Class @class)
{
if (!base.VisitClassDecl(@class) || !@class.IsDependent)
if (!base.VisitClassDecl(@class) || !@class.IsDependent ||
@class.Specializations.All(s => !s.IsGenerated))
return false;
var methodsWithDependentPointers = @class.Methods.Where(

14
tests/CSharp/CSharpTemplates.h

@ -309,6 +309,19 @@ public: @@ -309,6 +309,19 @@ public:
~DerivesFromExplicitSpecialization();
};
template <typename T>
class InternalWithExtension
{
public:
const T* extension();
};
template <typename T>
const T* InternalWithExtension<T>::extension()
{
return 0;
}
template <typename T>
class TemplateWithIndexer
{
@ -319,6 +332,7 @@ public: @@ -319,6 +332,7 @@ public:
private:
T t[1];
HasDefaultTemplateArgument<char> h;
InternalWithExtension<char> i;
};
template <typename T>

Loading…
Cancel
Save