Don't override explicit visibility attributes on class members with

type-based visibility.

llvm-svn: 117500
This commit is contained in:
John McCall 2010-10-27 22:31:22 +00:00
parent 7e8c4e061b
commit ff78c8a3ef
1 changed files with 3 additions and 2 deletions

View File

@ -419,9 +419,10 @@ static LVPair getLVForClassMember(const NamedDecl *D) {
const VisibilityAttr *VA = D->getAttr<VisibilityAttr>();
if (VA) LV.second = minVisibility(LV.second, GetVisibilityFromAttr(VA));
// If it's a value declaration, apply the LV from its type.
// If it's a value declaration and we don't have an explicit visibility
// attribute, apply the LV from its type.
// See the comment about namespace-scope variable decls above.
if (isa<ValueDecl>(D)) {
if (!VA && isa<ValueDecl>(D)) {
LVPair TypeLV = cast<ValueDecl>(D)->getType()->getLinkageAndVisibility();
if (TypeLV.first != ExternalLinkage)
LV.first = minLinkage(LV.first, UniqueExternalLinkage);