When ignoring visibility in an instantiation, still consider the linkage.
Similar fixes for function and member template to follow as I write the
testcases.

llvm-svn: 157470
diff --git a/clang/test/CodeGenCXX/visibility.cpp b/clang/test/CodeGenCXX/visibility.cpp
index 5870308..d889684 100644
--- a/clang/test/CodeGenCXX/visibility.cpp
+++ b/clang/test/CodeGenCXX/visibility.cpp
@@ -818,3 +818,17 @@
   // CHECK: define hidden void @_ZN6test433barINS_3fooEEEvv
   // CHECK-HIDDEN: define hidden void @_ZN6test433barINS_3fooEEEvv
 }
+
+namespace test44 {
+  template <typename T>
+  struct foo {
+    foo() {}
+  };
+  namespace {
+    struct bar;
+  }
+  template struct DEFAULT foo<bar>;
+  foo<bar> x;
+  // CHECK: define internal void @_ZN6test443fooINS_12_GLOBAL__N_13barEEC1Ev
+  // CHECK-HIDDEN: define internal void @_ZN6test443fooINS_12_GLOBAL__N_13barEEC1Ev
+}