diff options
author | John McCall <rjmccall@apple.com> | 2010-10-27 22:31:22 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-10-27 22:31:22 +0000 |
commit | 6f4ac4b18fdfc410b547c82457fd7b229e48ec16 (patch) | |
tree | 6cb70190e9ccd9da1cd572e18456ccd7be4f0524 /lib/AST/Decl.cpp | |
parent | c8e5cf8f725e111965debb7130ef7466c0c73884 (diff) |
Don't override explicit visibility attributes on class members with
type-based visibility.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117500 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Decl.cpp')
-rw-r--r-- | lib/AST/Decl.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp index 9c7654b9cb..cb03ff50e2 100644 --- a/lib/AST/Decl.cpp +++ b/lib/AST/Decl.cpp @@ -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); |