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 | ff78c8a3ef07c28583df225eb1d08dd45df2b78f (patch) | |
| tree | fed2db75c3f0797830404c80442bccc7731df7f7 /clang/lib/AST/Decl.cpp | |
| parent | 7e8c4e061ba209b1c68a3bcae90907bff7b41c64 (diff) | |
| download | bcm5719-llvm-ff78c8a3ef07c28583df225eb1d08dd45df2b78f.tar.gz bcm5719-llvm-ff78c8a3ef07c28583df225eb1d08dd45df2b78f.zip | |
Don't override explicit visibility attributes on class members with
type-based visibility.
llvm-svn: 117500
Diffstat (limited to 'clang/lib/AST/Decl.cpp')
| -rw-r--r-- | clang/lib/AST/Decl.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
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<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); |

