]> granicus.if.org Git - clang/commitdiff
Make sure to set the visible on a vtable; VTTs and typeinfo already
authorDouglas Gregor <dgregor@apple.com>
Mon, 14 Jun 2010 23:41:45 +0000 (23:41 +0000)
committerDouglas Gregor <dgregor@apple.com>
Mon, 14 Jun 2010 23:41:45 +0000 (23:41 +0000)
handle visibility properly. Fixes <rdar://problem/8091955>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@105977 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGVTables.cpp
test/CodeGenCXX/visibility.cpp

index 9d8ab5adb04469ce4dd8ab3f42365aa8d41e5736..6abac2609f5fa9022a949af72066add95d8d5827 100644 (file)
@@ -2926,6 +2926,9 @@ CodeGenVTables::EmitVTableDefinition(llvm::GlobalVariable *VTable,
   
   // Set the correct linkage.
   VTable->setLinkage(Linkage);
+  
+  // Set the right visibility.
+  CGM.setGlobalVisibility(VTable, RD);
 }
 
 llvm::GlobalVariable *
index 5edd27b8b279316aebb7c7bf1b0adf2e33cde57d..ee3c1795fbb7cdd271decf65660dcc2643659c3d 100644 (file)
@@ -5,7 +5,7 @@
 #define DEFAULT __attribute__((visibility("default")))
 
 // CHECK: @_ZN5Test425VariableInHiddenNamespaceE = hidden global i32 10
-
+// CHECK: @_ZTVN5Test63fooE = weak_odr hidden constant 
 namespace Test1 {
   // CHECK: define hidden void @_ZN5Test11fEv
   void HIDDEN f() { }
@@ -64,3 +64,21 @@ namespace Test5 {
     void g() { }
   }
 }
+
+// <rdar://problem/8091955>
+namespace Test6 {
+  struct HIDDEN foo {
+    foo() { }
+    void bonk();
+    virtual void bar() = 0;
+
+    virtual void zonk() {}
+  };
+
+  struct barc : public foo {
+    barc();
+    virtual void bar();
+  };
+
+  barc::barc() {}
+}