}
bool CodeGenModule::AlwaysHasLTOVisibilityPublic(const CXXRecordDecl *RD) {
- if (RD->hasAttr<LTOVisibilityPublicAttr>() || RD->hasAttr<UuidAttr>())
+ if (RD->hasAttr<LTOVisibilityPublicAttr>() || RD->hasAttr<UuidAttr>() ||
+ RD->hasAttr<DLLExportAttr>() || RD->hasAttr<DLLImportAttr>())
return true;
if (!getCodeGenOpts().LTOVisibilityPublicStd)
if (!isExternallyVisible(LV.getLinkage()))
return true;
- if (getTriple().isOSBinFormatCOFF()) {
- if (RD->hasAttr<DLLExportAttr>() || RD->hasAttr<DLLImportAttr>())
- return false;
- } else {
- if (LV.getVisibility() != HiddenVisibility)
- return false;
- }
+ if (!getTriple().isOSBinFormatCOFF() &&
+ LV.getVisibility() != HiddenVisibility)
+ return false;
return !AlwaysHasLTOVisibilityPublic(RD);
}
// MS: type.test{{.*}}!"?AUC2@@"
c2->f();
// ITANIUM: type.test{{.*}}!"_ZTS2C3"
- // MS: type.test{{.*}}!"?AUC3@@"
+ // MS-NOT: type.test{{.*}}!"?AUC3@@"
c3->f();
// ITANIUM: type.test{{.*}}!"_ZTS2C4"
- // MS: type.test{{.*}}!"?AUC4@@"
+ // MS-NOT: type.test{{.*}}!"?AUC4@@"
c4->f();
// ITANIUM-NOT: type.test{{.*}}!"_ZTS2C5"
// MS-NOT: type.test{{.*}}!"?AUC5@@"