[cfe-commits] r152493 - in /cfe/trunk: lib/AST/Decl.cpp test/CodeGenCXX/visibility.cpp
Rafael Espindola
rafael.espindola at gmail.com
Sat Mar 10 05:01:40 PST 2012
Author: rafael
Date: Sat Mar 10 07:01:40 2012
New Revision: 152493
URL: http://llvm.org/viewvc/llvm-project?rev=152493&view=rev
Log:
The type of a definition should not increase its visibility. Fixes PR12221.
Modified:
cfe/trunk/lib/AST/Decl.cpp
cfe/trunk/test/CodeGenCXX/visibility.cpp
Modified: cfe/trunk/lib/AST/Decl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Decl.cpp?rev=152493&r1=152492&r2=152493&view=diff
==============================================================================
--- cfe/trunk/lib/AST/Decl.cpp (original)
+++ cfe/trunk/lib/AST/Decl.cpp Sat Mar 10 07:01:40 2012
@@ -335,8 +335,8 @@
LinkageInfo TypeLV = getLVForType(Var->getType());
if (TypeLV.linkage() != ExternalLinkage)
return LinkageInfo::uniqueExternal();
- if (!LV.visibilityExplicit())
- LV.mergeVisibility(TypeLV.visibility(), TypeLV.visibilityExplicit());
+ LV.mergeVisibilityWithMin(TypeLV.visibility(),
+ TypeLV.visibilityExplicit());
}
if (Var->getStorageClass() == SC_PrivateExtern)
Modified: cfe/trunk/test/CodeGenCXX/visibility.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/visibility.cpp?rev=152493&r1=152492&r2=152493&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/visibility.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/visibility.cpp Sat Mar 10 07:01:40 2012
@@ -20,6 +20,14 @@
// CHECK-HIDDEN: @_ZN6test251aE = hidden global
}
+namespace test28 {
+ class DEFAULT foo {
+ };
+ foo myvec;
+ // CHECK: @_ZN6test285myvecE = global
+ // CHECK-HIDDEN: @_ZN6test285myvecE = hidden global
+}
+
// CHECK: @_ZN5Test425VariableInHiddenNamespaceE = hidden global i32 10
// CHECK: @_ZN5Test71aE = hidden global
// CHECK: @_ZN5Test71bE = global
More information about the cfe-commits
mailing list