From 1771f7462b3a716d041a9cb311ba4bc3f4ba2c29 Mon Sep 17 00:00:00 2001 From: Dimitar Dobrev Date: Thu, 4 Aug 2016 21:31:13 +0300 Subject: [PATCH] Fixed the generation of internals for nested template specialisations with pointers as T. Signed-off-by: Dimitar Dobrev --- src/Generator/Generators/CSharp/CSharpSources.cs | 3 ++- tests/CSharp/CSharpTemplates.h | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Generator/Generators/CSharp/CSharpSources.cs b/src/Generator/Generators/CSharp/CSharpSources.cs index 84d342ec..77160f63 100644 --- a/src/Generator/Generators/CSharp/CSharpSources.cs +++ b/src/Generator/Generators/CSharp/CSharpSources.cs @@ -80,7 +80,8 @@ namespace CppSharp.Generators.CSharp f => !(f.Type.Desugar() is TemplateParameterType))) return string.Empty; - if (specialization.Arguments.All( + if (!nested && + specialization.Arguments.All( a => a.Type.Type != null && a.Type.Type.IsAddress())) return "_Ptr"; diff --git a/tests/CSharp/CSharpTemplates.h b/tests/CSharp/CSharpTemplates.h index 5d9bd72d..2e5e7988 100644 --- a/tests/CSharp/CSharpTemplates.h +++ b/tests/CSharp/CSharpTemplates.h @@ -69,6 +69,8 @@ private: DependentValueFields> specializeWithSpecialization; DependentValueFields> specializeWithSameSpecialization; NestedTemplate nestedTemplate; + DependentValueFields> nestedDependentPointer1; + DependentValueFields> nestedDependentPointer2; void completeSpecializationInParameter(DependentValueFields p1, DependentValueFields p2, DependentValueFields p3);