From ff78c8a3ef07c28583df225eb1d08dd45df2b78f Mon Sep 17 00:00:00 2001 From: John McCall Date: Wed, 27 Oct 2010 22:31:22 +0000 Subject: Don't override explicit visibility attributes on class members with type-based visibility. llvm-svn: 117500 --- clang/lib/AST/Decl.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'clang/lib/AST/Decl.cpp') diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp index 9c7654b9cbe..cb03ff50e25 100644 --- a/clang/lib/AST/Decl.cpp +++ b/clang/lib/AST/Decl.cpp @@ -419,9 +419,10 @@ static LVPair getLVForClassMember(const NamedDecl *D) { const VisibilityAttr *VA = D->getAttr(); 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(D)) { + if (!VA && isa(D)) { LVPair TypeLV = cast(D)->getType()->getLinkageAndVisibility(); if (TypeLV.first != ExternalLinkage) LV.first = minLinkage(LV.first, UniqueExternalLinkage); -- cgit v1.2.3