// scope and no storage-class specifier, its linkage is
// external.
LinkageInfo LV;
- LV.mergeVisibility(Context.getLangOpts().getVisibilityMode());
if (F.ConsiderVisibilityAttributes) {
if (llvm::Optional<Visibility> Vis = D->getExplicitVisibility()) {
}
}
+ LV.mergeVisibility(Context.getLangOpts().getVisibilityMode());
+
// C++ [basic.link]p4:
// A name having namespace scope has external linkage if it is the
return LinkageInfo::none();
LinkageInfo LV;
- LV.mergeVisibility(D->getASTContext().getLangOpts().getVisibilityMode());
bool DHasExplicitVisibility = false;
// If we have an explicit visibility attribute, merge that in.
if (LV.linkage() == UniqueExternalLinkage)
return LinkageInfo::uniqueExternal();
+ LV.mergeVisibility(D->getASTContext().getLangOpts().getVisibilityMode());
+
if (const CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(D)) {
// If the type of the function uses a type with unique-external
// linkage, it's not legally usable from outside this translation unit.