1 // PR c++/27000
2 // Implicitly instantiated templates should not be affected by
3 // #pragma visibility.
4 
5 /* { dg-do compile } */
6 /* { dg-require-visibility "" } */
7 /* { dg-final { scan-not-hidden "_ZN1SIiED1Ev" } } */
8 /* { dg-final { scan-not-hidden "_ZN1SIiEC1ERKi" } } */
9 
10 template <class T>
11 struct S
12 {
13   S (const T &);
14   ~S ();
15   T t;
16 };
17 
18 template <class T>
S(const T & x)19 S<T>::S (const T &x)
20 {
21   t = x;
22 }
23 
24 template <class T>
~S()25 S<T>::~S ()
26 {
27 }
28 
29 #pragma GCC visibility push(hidden)
30 struct U
31 {
32   S<int> s;
UU33   U () : s (6) { }
34 } u;
35 #pragma GCC visibility pop
36