diff --git a/src/Parser/Parser.cpp b/src/Parser/Parser.cpp index f6e8a599..bde1ec8f 100644 --- a/src/Parser/Parser.cpp +++ b/src/Parser/Parser.cpp @@ -318,27 +318,7 @@ static CppSharp::AccessSpecifier ConvertToAccess(clang::AccessSpecifier AS) return CppSharp::AccessSpecifier::Public; } -static bool HasClassDependentFields(clang::CXXRecordDecl* Record) -{ - using namespace clang; - - for(auto it = Record->field_begin(); it != Record->field_end(); ++it) - { - clang::FieldDecl* FD = (*it); - - switch (FD->getType()->getTypeClass()) { - #define TYPE(Class, Base) - #define ABSTRACT_TYPE(Class, Base) - #define NON_CANONICAL_TYPE(Class, Base) - #define DEPENDENT_TYPE(Class, Base) case Type::Class: - #include "clang/AST/TypeNodes.def" - return true; - } - } - return false; -} - -CppSharp::Class^ Parser::WalkRecordCXX(clang::CXXRecordDecl* Record, bool IsDependent) +CppSharp::Class^ Parser::WalkRecordCXX(clang::CXXRecordDecl* Record) { using namespace clang; using namespace clix; @@ -398,12 +378,9 @@ CppSharp::Class^ Parser::WalkRecordCXX(clang::CXXRecordDecl* Record, bool IsDepe RC->Methods->Add(Method); } - if (!IsDependent) - IsDependent = HasClassDependentFields(Record); - // Get the record layout information. const ASTRecordLayout* Layout = 0; - if (/*!IsDependent && */!Record->isDependentType()) + if (!Record->isDependentType()) { Layout = &C->getASTContext().getASTRecordLayout(Record); RC->Layout->Alignment = (int)Layout-> getAlignment().getQuantity(); @@ -470,9 +447,7 @@ CppSharp::ClassTemplate^ Parser::WalkClassTemplate(clang::ClassTemplateDecl* TD) using namespace clang; using namespace clix; - auto NS = GetNamespace(TD); - - auto Class = WalkRecordCXX(TD->getTemplatedDecl(), /*IsDependent*/true); + auto Class = WalkRecordCXX(TD->getTemplatedDecl()); CppSharp::ClassTemplate^ CT = gcnew CppSharp::ClassTemplate(Class); return CT; diff --git a/src/Parser/Parser.h b/src/Parser/Parser.h index d0c547ce..1ef157ab 100644 --- a/src/Parser/Parser.h +++ b/src/Parser/Parser.h @@ -137,7 +137,7 @@ protected: CppSharp::Enumeration^ WalkEnum(clang::EnumDecl*); CppSharp::Function^ WalkFunction(clang::FunctionDecl*, bool IsDependent = false, bool AddToNamespace = true); - CppSharp::Class^ WalkRecordCXX(clang::CXXRecordDecl*, bool IsDependent = false); + CppSharp::Class^ WalkRecordCXX(clang::CXXRecordDecl*); CppSharp::Method^ WalkMethodCXX(clang::CXXMethodDecl*); CppSharp::Field^ WalkFieldCXX(clang::FieldDecl*, CppSharp::Class^); CppSharp::ClassTemplate^ Parser::WalkClassTemplate(clang::ClassTemplateDecl*);