summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2012-07-13 18:04:45 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2012-07-13 18:04:45 +0000
commit385c04269fd941dcd3fba68bf26fc91778c07692 (patch)
tree50602f53059ca7a6feab44c09bbf06245db338cf /clang/test/CodeGenCXX
parentc51d70d9d5896509237814010af120ea4605f842 (diff)
downloadbcm5719-llvm-385c04269fd941dcd3fba68bf26fc91778c07692.tar.gz
bcm5719-llvm-385c04269fd941dcd3fba68bf26fc91778c07692.zip
Apply visibility pragmas to class template declarations. This is needed because
we might use the declaration to build a type before seeing the definition. llvm-svn: 160176
Diffstat (limited to 'clang/test/CodeGenCXX')
-rw-r--r--clang/test/CodeGenCXX/visibility.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/visibility.cpp b/clang/test/CodeGenCXX/visibility.cpp
index 92b7f4453fe..3ea232dc00b 100644
--- a/clang/test/CodeGenCXX/visibility.cpp
+++ b/clang/test/CodeGenCXX/visibility.cpp
@@ -1044,3 +1044,20 @@ namespace test56 {
// CHECK: declare hidden void @_ZN6test563fooIiE3barEv
// CHECK-HIDDEN: declare hidden void @_ZN6test563fooIiE3barEv
}
+
+namespace test57 {
+#pragma GCC visibility push(hidden)
+ template <class T>
+ struct foo;
+ void bar(foo<int>*);
+ template <class T>
+ struct foo {
+ static void zed();
+ };
+ void bah() {
+ foo<int>::zed();
+ }
+#pragma GCC visibility pop
+ // CHECK: declare hidden void @_ZN6test573fooIiE3zedEv
+ // CHECK-HIDDEN: declare hidden void @_ZN6test573fooIiE3zedEv
+}
OpenPOWER on IntegriCloud