[cfe-commits] r117500 - /cfe/trunk/lib/AST/Decl.cpp
John McCall
rjmccall at apple.com
Wed Oct 27 15:31:22 PDT 2010
Author: rjmccall
Date: Wed Oct 27 17:31:22 2010
New Revision: 117500
URL: http://llvm.org/viewvc/llvm-project?rev=117500&view=rev
Log:
Don't override explicit visibility attributes on class members with
type-based visibility.
Modified:
cfe/trunk/lib/AST/Decl.cpp
Modified: cfe/trunk/lib/AST/Decl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Decl.cpp?rev=117500&r1=117499&r2=117500&view=diff
==============================================================================
--- cfe/trunk/lib/AST/Decl.cpp (original)
+++ cfe/trunk/lib/AST/Decl.cpp Wed Oct 27 17:31:22 2010
@@ -419,9 +419,10 @@
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);
More information about the cfe-commits
mailing list