diff --git a/src/AST/Function.cs b/src/AST/Function.cs index 9d7431c2..35563fde 100644 --- a/src/AST/Function.cs +++ b/src/AST/Function.cs @@ -75,6 +75,9 @@ namespace CppSharp.AST public bool IsInline { get; set; } public bool IsPure { get; set; } + public CXXOperatorKind OperatorKind { get; set; } + public bool IsOperator { get { return OperatorKind != CXXOperatorKind.None; } } + public CallingConvention CallingConvention { get; set; } public bool IsThisCall diff --git a/src/AST/Method.cs b/src/AST/Method.cs index 1a8470f1..7dfd67a5 100644 --- a/src/AST/Method.cs +++ b/src/AST/Method.cs @@ -80,7 +80,6 @@ namespace CppSharp.AST public bool IsProxy { get; set; } public CXXMethodKind Kind; - public CXXOperatorKind OperatorKind; public bool IsConstructor { @@ -92,11 +91,6 @@ namespace CppSharp.AST get { return Kind == CXXMethodKind.Destructor; } } - public bool IsOperator - { - get { return Kind == CXXMethodKind.Operator; } - } - public bool IsDefaultConstructor; public bool IsCopyConstructor; public bool IsMoveConstructor; diff --git a/src/Parser/Parser.cpp b/src/Parser/Parser.cpp index 39dc07b6..1250b78a 100644 --- a/src/Parser/Parser.cpp +++ b/src/Parser/Parser.cpp @@ -788,7 +788,6 @@ CppSharp::AST::Method^ Parser::WalkMethodCXX(clang::CXXMethodDecl* MD) CppSharp::AST::Method^ Method = gcnew CppSharp::AST::Method(); Method->Access = ConvertToAccess(MD->getAccess()); Method->Kind = GetMethodKindFromDecl(Name); - Method->OperatorKind = GetOperatorKindFromDecl(Name); Method->IsStatic = MD->isStatic(); Method->IsVirtual = MD->isVirtual(); Method->IsOverride = MD->size_overridden_methods() > 0; @@ -1517,6 +1516,8 @@ void Parser::WalkFunction(clang::FunctionDecl* FD, CppSharp::AST::Function^ F, auto AbiCC = GetAbiCallConv(CC, FD->isCXXInstanceMember(), FD->isVariadic()); F->CallingConvention = ConvertCallConv(AbiCC); + F->OperatorKind = GetOperatorKindFromDecl(FD->getDeclName()); + TypeLoc RTL; if (auto TSI = FD->getTypeSourceInfo()) {