From 853fa889d274bf06a369f2c89dbf13688f601006 Mon Sep 17 00:00:00 2001 From: Dimitar Dobrev Date: Thu, 7 Jul 2016 01:08:49 +0300 Subject: [PATCH] Removed false negatives when renaming template specialisations. Signed-off-by: Dimitar Dobrev --- src/Generator/Passes/RenamePass.cs | 3 +++ tests/CSharp/CSharp.h | 12 ++++++++++++ 2 files changed, 15 insertions(+) diff --git a/src/Generator/Passes/RenamePass.cs b/src/Generator/Passes/RenamePass.cs index 8549977c..6e1004b5 100644 --- a/src/Generator/Passes/RenamePass.cs +++ b/src/Generator/Passes/RenamePass.cs @@ -131,6 +131,9 @@ namespace CppSharp.Passes let pointerType = typedefDecl.Type.Desugar() as PointerType where pointerType != null && pointerType.Pointee is FunctionType select typedefDecl); + var specialization = decl as ClassTemplateSpecialization; + if (specialization != null) + declarations.RemoveAll(d => specialization.TemplatedDecl.TemplatedDecl == d); var result = declarations.Any(d => d != decl && d.Name == newName); if (result) diff --git a/tests/CSharp/CSharp.h b/tests/CSharp/CSharp.h index 01b464de..a49c120d 100644 --- a/tests/CSharp/CSharp.h +++ b/tests/CSharp/CSharp.h @@ -939,3 +939,15 @@ public: int conflictWithProperty(); virtual int getConflictWithProperty() = 0; }; + +template +class lowerCase +{ +}; + +class HasFieldsOfLowerCaseTemplate +{ +private: + lowerCase i; + lowerCase l; +};