diff --git a/src/AST/ASTVisitor.cs b/src/AST/ASTVisitor.cs index 9a38ac21..337c51e2 100644 --- a/src/AST/ASTVisitor.cs +++ b/src/AST/ASTVisitor.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; namespace CppSharp.AST { @@ -389,7 +390,7 @@ namespace CppSharp.AST return parameter.Type.Visit(this, parameter.QualifiedType.Qualifiers); } - public virtual bool VisitTypedefDecl(TypedefDecl typedef) + public bool VisitTypedefNameDecl(TypedefNameDecl typedef) { if (!VisitDeclaration(typedef)) return false; @@ -397,12 +398,14 @@ namespace CppSharp.AST return typedef.Type.Visit(this, typedef.QualifiedType.Qualifiers); } - public bool VisitTypeAliasDecl(TypeAlias typeAlias) + public virtual bool VisitTypedefDecl(TypedefDecl typedef) { - if (!VisitDeclaration(typeAlias)) - return false; + return VisitTypedefNameDecl(typedef); + } - return typeAlias.Type.Visit(this, typeAlias.QualifiedType.Qualifiers); + public bool VisitTypeAliasDecl(TypeAlias typeAlias) + { + return VisitTypedefNameDecl(typeAlias); } public virtual bool VisitEnumDecl(Enumeration @enum) diff --git a/src/AST/CppTypePrinter.cs b/src/AST/CppTypePrinter.cs index ccb9520b..087ec0fe 100644 --- a/src/AST/CppTypePrinter.cs +++ b/src/AST/CppTypePrinter.cs @@ -442,6 +442,11 @@ namespace CppSharp.AST nonTypeTemplateParameter.DefaultArgument.String); } + public string VisitTypedefNameDecl(TypedefNameDecl typedef) + { + throw new NotImplementedException(); + } + public virtual string VisitTypeAliasTemplateDecl(TypeAliasTemplate typeAliasTemplate) { throw new NotImplementedException(); diff --git a/src/AST/Declaration.cs b/src/AST/Declaration.cs index 6f3c719a..3d5b160b 100644 --- a/src/AST/Declaration.cs +++ b/src/AST/Declaration.cs @@ -372,6 +372,7 @@ namespace CppSharp.AST T VisitFunctionDecl(Function function); T VisitMethodDecl(Method method); T VisitParameterDecl(Parameter parameter); + T VisitTypedefNameDecl(TypedefNameDecl typedef); T VisitTypedefDecl(TypedefDecl typedef); T VisitTypeAliasDecl(TypeAlias typeAlias); T VisitEnumDecl(Enumeration @enum); diff --git a/src/Generator.Tests/AST/TestAST.cs b/src/Generator.Tests/AST/TestAST.cs index 9ec2b289..b251a1cb 100644 --- a/src/Generator.Tests/AST/TestAST.cs +++ b/src/Generator.Tests/AST/TestAST.cs @@ -206,6 +206,11 @@ namespace CppSharp.Generator.Tests.AST { throw new NotImplementedException(); } + + public bool VisitTypedefNameDecl(TypedefNameDecl typedef) + { + throw new NotImplementedException(); + } } #endregion diff --git a/src/Generator/Generators/CSharp/CSharpSources.cs b/src/Generator/Generators/CSharp/CSharpSources.cs index ad184945..548f3fe1 100644 --- a/src/Generator/Generators/CSharp/CSharpSources.cs +++ b/src/Generator/Generators/CSharp/CSharpSources.cs @@ -2999,7 +2999,7 @@ namespace CppSharp.Generators.CSharp #endregion - public override bool VisitTypedefDecl(TypedefDecl typedef) + public override bool VisitTypedefNameDecl(TypedefNameDecl typedef) { if (!typedef.IsGenerated) return false; diff --git a/src/Generator/Generators/CodeGenerator.cs b/src/Generator/Generators/CodeGenerator.cs index 7e238175..606b6fa9 100644 --- a/src/Generator/Generators/CodeGenerator.cs +++ b/src/Generator/Generators/CodeGenerator.cs @@ -90,14 +90,19 @@ namespace CppSharp.Generators throw new NotImplementedException(); } - public virtual bool VisitTypedefDecl(TypedefDecl typedef) + public virtual bool VisitTypedefNameDecl(TypedefNameDecl typedef) { throw new NotImplementedException(); } + public virtual bool VisitTypedefDecl(TypedefDecl typedef) + { + return VisitTypedefNameDecl(typedef); + } + public virtual bool VisitTypeAliasDecl(TypeAlias typeAlias) { - throw new NotImplementedException(); + return VisitTypedefNameDecl(typeAlias); } public virtual bool VisitEnumDecl(Enumeration @enum) diff --git a/src/Generator/Generators/TypePrinter.cs b/src/Generator/Generators/TypePrinter.cs index 2478809f..e91cb39b 100644 --- a/src/Generator/Generators/TypePrinter.cs +++ b/src/Generator/Generators/TypePrinter.cs @@ -274,6 +274,11 @@ namespace CppSharp.Generators throw new NotImplementedException(); } + public TypePrinterResult VisitTypedefNameDecl(TypedefNameDecl typedef) + { + throw new NotImplementedException(); + } + public virtual TypePrinterResult VisitTypedefType(TypedefType typedef, TypeQualifiers quals) {