}
}
+ // If the old declaration was found in an inline namespace and the new
+ // declaration was qualified, update the DeclContext to match.
+ adjustDeclContextForDeclaratorDecl(New, Old);
+
// If the old declaration is invalid, just give up here.
if (Old->isInvalidDecl())
return true;
return New->setInvalidDecl();
}
+ // If the old declaration was found in an inline namespace and the new
+ // declaration was qualified, update the DeclContext to match.
+ adjustDeclContextForDeclaratorDecl(New, Old);
+
// Ensure the template parameters are compatible.
if (NewTemplate &&
!TemplateParameterListsAreEqual(NewTemplate->getTemplateParameters(),
New->setPreviousDecl(Old);
if (NewTemplate)
NewTemplate->setPreviousDecl(OldTemplate);
- adjustDeclContextForDeclaratorDecl(New, Old);
// Inherit access appropriately.
New->setAccess(Old->getAccess());
NewTemplateDecl->mergePrevDecl(OldTemplateDecl);
NewFD->setPreviousDeclaration(OldFD);
- adjustDeclContextForDeclaratorDecl(NewFD, OldFD);
if (NewFD->isCXXClassMember()) {
NewFD->setAccess(OldTemplateDecl->getAccess());
NewTemplateDecl->setAccess(OldTemplateDecl->getAccess());
auto *OldFD = cast<FunctionDecl>(OldDecl);
// This needs to happen first so that 'inline' propagates.
NewFD->setPreviousDeclaration(OldFD);
- adjustDeclContextForDeclaratorDecl(NewFD, OldFD);
if (NewFD->isCXXClassMember())
NewFD->setAccess(OldFD->getAccess());
}