Fix a bug in my previous commit. The problem is not that we were not using the
canonical decl for the template, but that we were not merging attributes for
templates at all!
llvm-svn: 160157
diff --git a/clang/test/CodeGenCXX/visibility.cpp b/clang/test/CodeGenCXX/visibility.cpp
index 94fb290..92b7f44 100644
--- a/clang/test/CodeGenCXX/visibility.cpp
+++ b/clang/test/CodeGenCXX/visibility.cpp
@@ -1031,3 +1031,16 @@
// CHECK: declare hidden void @_ZN6test553fooIiE3barEv
// CHECK-HIDDEN: declare hidden void @_ZN6test553fooIiE3barEv
}
+
+namespace test56 {
+ template <class T> struct foo;
+ template <class T>
+ struct __attribute__((visibility("hidden"))) foo {
+ static void bar();
+ };
+ void foobar() {
+ foo<int>::bar();
+ }
+ // CHECK: declare hidden void @_ZN6test563fooIiE3barEv
+ // CHECK-HIDDEN: declare hidden void @_ZN6test563fooIiE3barEv
+}