Permalink
Browse files

Removed the fixing of names of constructors and destructors.

Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
  • Loading branch information...
ddobrev committed Aug 12, 2017
1 parent 2bff7a3 commit 1c81a92061488347be398d8c95d311e7fcc9d052
Showing with 13 additions and 2 deletions.
  1. +9 −0 src/Generator.Tests/AST/TestAST.cs
  2. +4 −2 src/Generator/Passes/CleanInvalidDeclNamesPass.cs
@@ -553,5 +553,14 @@ public void TestDependentNameType()
Assert.That($"{type}",
Is.EqualTo("global::Test.TestTemplateClass<T>.NestedInTemplate"));
}
[Test]
public void TestTemplateConstructorName()
{
new CleanInvalidDeclNamesPass { Context = Driver.Context }.VisitASTContext(AstContext);
var template = AstContext.FindClass("TestTemplateClass").First();
foreach (var constructor in template.Constructors)
Assert.That(constructor.Name, Is.EqualTo("TestTemplateClass<T>"));
}
}
}
@@ -47,8 +47,10 @@ public override bool VisitDeclaration(Declaration decl)
return true;
}
Function function = decl as Function;
if ((function == null || !function.IsOperator) && !(decl is Enumeration))
var function = decl as Function;
var method = function as Method;
if ((function == null || !function.IsOperator) && !(decl is Enumeration) &&
(method == null || method.Kind == CXXMethodKind.Normal))
decl.Name = CheckName(decl.Name);
StringHelpers.CleanupText(ref decl.DebugText);

0 comments on commit 1c81a92

Please sign in to comment.