aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/Decl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/AST/Decl.cpp')
-rw-r--r--lib/AST/Decl.cpp5
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);