diff --git a/src/Bridge/Declaration.cs b/src/Bridge/Declaration.cs index 91162123..ed9d5f22 100644 --- a/src/Bridge/Declaration.cs +++ b/src/Bridge/Declaration.cs @@ -144,6 +144,9 @@ namespace CppSharp // True if the declaration is incomplete (no definition). public bool IsIncomplete; + // True if the declaration is dependent. + public bool IsDependent; + // Keeps a reference to the complete version of this declaration. public Declaration CompleteDeclaration; diff --git a/src/Generator/Generators/CSharp/CSharpTextTemplate.cs b/src/Generator/Generators/CSharp/CSharpTextTemplate.cs index d2864e41..1bc9b8f6 100644 --- a/src/Generator/Generators/CSharp/CSharpTextTemplate.cs +++ b/src/Generator/Generators/CSharp/CSharpTextTemplate.cs @@ -167,6 +167,9 @@ namespace CppSharp.Generators.CSharp if (@class.Ignore || @class.IsIncomplete) continue; + if (@class.IsDependent) + continue; + NewLineIfNeeded(); GenerateClass(@class); NeedNewLine(); diff --git a/src/Parser/Parser.cpp b/src/Parser/Parser.cpp index cae0678e..30e89917 100644 --- a/src/Parser/Parser.cpp +++ b/src/Parser/Parser.cpp @@ -373,6 +373,7 @@ CppSharp::Class^ Parser::WalkRecordCXX(clang::CXXRecordDecl* Record, bool IsDepe RC->IsPOD = Record->isPOD(); RC->IsUnion = Record->isUnion(); RC->IsAbstract = Record->isAbstract(); + RC->IsDependent = Record->isDependentType(); auto &Sema = C->getSema(); Sema.ForceDeclarationOfImplicitMembers(Record); @@ -402,7 +403,7 @@ CppSharp::Class^ Parser::WalkRecordCXX(clang::CXXRecordDecl* Record, bool IsDepe // Get the record layout information. const ASTRecordLayout* Layout = 0; - if (!IsDependent) + if (/*!IsDependent && */!Record->isDependentType()) { Layout = &C->getASTContext().getASTRecordLayout(Record); RC->Layout->Alignment = (int)Layout-> getAlignment().getQuantity();