aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/CodeGen/CGVTT.cpp3
-rw-r--r--test/CodeGenCXX/vtable-linkage.cpp4
2 files changed, 6 insertions, 1 deletions
diff --git a/lib/CodeGen/CGVTT.cpp b/lib/CodeGen/CGVTT.cpp
index 5ebe92b539..fd8f576a04 100644
--- a/lib/CodeGen/CGVTT.cpp
+++ b/lib/CodeGen/CGVTT.cpp
@@ -384,6 +384,9 @@ CodeGenVTables::EmitVTTDefinition(llvm::GlobalVariable *VTT,
// Set the correct linkage.
VTT->setLinkage(Linkage);
+
+ // Set the right visibility.
+ CGM.setTypeVisibility(VTT, RD, /*ForRTTI=*/false);
}
llvm::GlobalVariable *CodeGenVTables::GetAddrOfVTT(const CXXRecordDecl *RD) {
diff --git a/test/CodeGenCXX/vtable-linkage.cpp b/test/CodeGenCXX/vtable-linkage.cpp
index 93ff165114..fc14c71a0e 100644
--- a/test/CodeGenCXX/vtable-linkage.cpp
+++ b/test/CodeGenCXX/vtable-linkage.cpp
@@ -32,7 +32,7 @@ struct B {
B::B() { }
-struct C {
+struct C : virtual B {
C();
virtual void f() { }
};
@@ -106,9 +106,11 @@ void use_F() {
// CHECK-2: @_ZTV1C = linkonce_odr unnamed_addr constant
// CHECK-2: @_ZTS1C = linkonce_odr constant
// CHECK-2: @_ZTI1C = linkonce_odr unnamed_addr constant
+// CHECK-2: @_ZTT1C = linkonce_odr unnamed_addr constant
// CHECK-2-HIDDEN: @_ZTV1C = linkonce_odr hidden unnamed_addr constant
// CHECK-2-HIDDEN: @_ZTS1C = linkonce_odr constant
// CHECK-2-HIDDEN: @_ZTI1C = linkonce_odr hidden unnamed_addr constant
+// CHECK-2-HIDDEN: @_ZTT1C = linkonce_odr hidden unnamed_addr constant
// D has a key function that is defined in this translation unit so its vtable is
// defined in the translation unit.