aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGenCXX/template-inner-struct-visibility-hidden.cpp
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2010-09-27 21:02:09 +0000
committerNico Weber <nicolasweber@gmx.de>2010-09-27 21:02:09 +0000
commitc956b6e8ff909858cec5832f024d2af9c58f190b (patch)
treee56bdf9bbc0881166b65aa6f3ae0e91d6f4ecb67 /test/CodeGenCXX/template-inner-struct-visibility-hidden.cpp
parentb4a88efcab72b2df19428699bcec8461d9fd55a4 (diff)
Correctly set "explicit template instantiation" kind on inner structs of templates whose explicit instantiation is first declared and then defined.
Fixes http://llvm.org/pr8207 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114874 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/template-inner-struct-visibility-hidden.cpp')
-rw-r--r--test/CodeGenCXX/template-inner-struct-visibility-hidden.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/CodeGenCXX/template-inner-struct-visibility-hidden.cpp b/test/CodeGenCXX/template-inner-struct-visibility-hidden.cpp
new file mode 100644
index 0000000000..ca4446cd20
--- /dev/null
+++ b/test/CodeGenCXX/template-inner-struct-visibility-hidden.cpp
@@ -0,0 +1,24 @@
+// RUN: %clang_cc1 -fvisibility hidden -emit-llvm -o - %s | FileCheck %s
+
+// Verify that symbols are hidden.
+// CHECK: @_ZN1CIiE5Inner6Inner26StaticE = weak hidden global
+// CHECK: define weak_odr hidden void @_ZN1CIiE5Inner1fEv
+// CHECK: define weak_odr hidden void @_ZN1CIiE5Inner6Inner21gEv
+
+template<typename T>
+struct C {
+ struct Inner {
+ void f();
+ struct Inner2 {
+ void g();
+ static int Static;
+ };
+ };
+};
+
+template<typename T> void C<T>::Inner::f() { }
+template<typename T> void C<T>::Inner::Inner2::g() { }
+template<typename T> int C<T>::Inner::Inner2::Static;
+
+extern template struct C<int>;
+template struct C<int>;