Browse Source

Removed false negatives when renaming template specialisations.

Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
pull/661/head
Dimitar Dobrev 9 years ago
parent
commit
853fa889d2
  1. 3
      src/Generator/Passes/RenamePass.cs
  2. 12
      tests/CSharp/CSharp.h

3
src/Generator/Passes/RenamePass.cs

@ -131,6 +131,9 @@ namespace CppSharp.Passes @@ -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)

12
tests/CSharp/CSharp.h

@ -939,3 +939,15 @@ public: @@ -939,3 +939,15 @@ public:
int conflictWithProperty();
virtual int getConflictWithProperty() = 0;
};
template <typename T>
class lowerCase
{
};
class HasFieldsOfLowerCaseTemplate
{
private:
lowerCase<int> i;
lowerCase<long> l;
};

Loading…
Cancel
Save