|
|
|
@ -42,6 +42,7 @@
@@ -42,6 +42,7 @@
|
|
|
|
|
#include <clang/Parse/ParseAST.h> |
|
|
|
|
#include <clang/Sema/Sema.h> |
|
|
|
|
#include <clang/Sema/SemaConsumer.h> |
|
|
|
|
#include <clang/Sema/Template.h> |
|
|
|
|
#include <clang/Frontend/Utils.h> |
|
|
|
|
#include <clang/Driver/Driver.h> |
|
|
|
|
#include <clang/Driver/ToolChain.h> |
|
|
|
@ -3053,8 +3054,7 @@ void Parser::CompleteIfSpecializationType(const clang::QualType& QualType)
@@ -3053,8 +3054,7 @@ void Parser::CompleteIfSpecializationType(const clang::QualType& QualType)
|
|
|
|
|
RD = const_cast<CXXRecordDecl*>(Type->getPointeeCXXRecordDecl()); |
|
|
|
|
ClassTemplateSpecializationDecl* CTS; |
|
|
|
|
if (!RD || |
|
|
|
|
!(CTS = llvm::dyn_cast<ClassTemplateSpecializationDecl>(RD)) || |
|
|
|
|
CTS->isCompleteDefinition()) |
|
|
|
|
!(CTS = llvm::dyn_cast<ClassTemplateSpecializationDecl>(RD))) |
|
|
|
|
return; |
|
|
|
|
|
|
|
|
|
auto existingClient = c->getSema().getDiagnostics().getClient(); |
|
|
|
@ -3065,8 +3065,7 @@ void Parser::CompleteIfSpecializationType(const clang::QualType& QualType)
@@ -3065,8 +3065,7 @@ void Parser::CompleteIfSpecializationType(const clang::QualType& QualType)
|
|
|
|
|
Scope Scope(nullptr, Scope::ScopeFlags::ClassScope, c->getSema().getDiagnostics()); |
|
|
|
|
c->getSema().TUScope = &Scope; |
|
|
|
|
|
|
|
|
|
c->getSema().InstantiateClassTemplateSpecialization(CTS->getBeginLoc(), |
|
|
|
|
CTS, TSK_ImplicitInstantiation, false); |
|
|
|
|
InstantiateSpecialization(CTS); |
|
|
|
|
|
|
|
|
|
c->getSema().getDiagnostics().setClient(existingClient, false); |
|
|
|
|
c->getSema().TUScope = nullptr; |
|
|
|
@ -3082,6 +3081,32 @@ void Parser::CompleteIfSpecializationType(const clang::QualType& QualType)
@@ -3082,6 +3081,32 @@ void Parser::CompleteIfSpecializationType(const clang::QualType& QualType)
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void Parser::InstantiateSpecialization(clang::ClassTemplateSpecializationDecl* CTS) |
|
|
|
|
{ |
|
|
|
|
using namespace clang; |
|
|
|
|
|
|
|
|
|
if (!CTS->isCompleteDefinition()) |
|
|
|
|
{ |
|
|
|
|
c->getSema().InstantiateClassTemplateSpecialization(CTS->getBeginLoc(), |
|
|
|
|
CTS, TSK_ImplicitInstantiation, false); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
for (auto Decl : CTS->decls()) |
|
|
|
|
{ |
|
|
|
|
if (Decl->getKind() == Decl::Kind::CXXRecord) |
|
|
|
|
{ |
|
|
|
|
CXXRecordDecl* Nested = cast<CXXRecordDecl>(Decl); |
|
|
|
|
CXXRecordDecl* Template = Nested->getInstantiatedFromMemberClass(); |
|
|
|
|
if (Template && !Nested->isCompleteDefinition() && !Nested->hasDefinition()) |
|
|
|
|
{ |
|
|
|
|
c->getSema().InstantiateClass(Nested->getBeginLoc(), Nested, Template, |
|
|
|
|
MultiLevelTemplateArgumentList(CTS->getTemplateArgs()), |
|
|
|
|
TSK_ImplicitInstantiation, false); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Parameter* Parser::WalkParameter(const clang::ParmVarDecl* PVD, |
|
|
|
|
const clang::SourceLocation& ParamStartLoc) |
|
|
|
|
{ |
|
|
|
|