Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 15 additions & 14 deletions clang/lib/AST/DeclTemplate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,22 +207,23 @@ unsigned TemplateParameterList::getDepth() const {
return cast<TemplateTemplateParmDecl>(FirstParm)->getDepth();
}

static bool AdoptTemplateParameterList(TemplateParameterList *Params,
DeclContext *Owner) {
bool Invalid = false;
for (NamedDecl *P : *Params) {
P->setDeclContext(Owner);

if (const auto *TTP = dyn_cast<TemplateTemplateParmDecl>(P))
if (AdoptTemplateParameterList(TTP->getTemplateParameters(), Owner))
Invalid = true;

if (P->isInvalidDecl())
Invalid = true;
}
return Invalid;
static bool AdoptTemplateParameterList ( TemplateParameterList * Params ,
DeclContext * Owner ) {
bool Invalid = false ;
for ( NamedDecl * P : * Params ) {
P -> setDeclContext ( Owner ) ;

if ( const auto * TTP = dyn_cast < TemplateTemplateParmDecl > ( P ) )
if ( AdoptTemplateParameterList ( TTP -> getTemplateParameters() , Owner ) )
Invalid = true ;

if ( P -> isInvalidDecl() )
Invalid = true ;
}
return Invalid ;
}


void TemplateParameterList::getAssociatedConstraints(
llvm::SmallVectorImpl<AssociatedConstraint> &ACs) const {
if (HasConstrainedParameters)
Expand Down