PR c++/26905
[official-gcc.git] / gcc / testsuite / g++.dg / ext / visibility / template2.C
blob8db96db564942a6f09af1154e590971b370ab88e
1 // PR c++/27000
2 // Implicitly instantiated templates should not be affected by
3 // #pragma visibility.
5 /* { dg-do compile } */
6 /* { dg-require-visibility "" } */
7 /* { dg-final { scan-not-hidden "_ZN1SIiED1Ev" } } */
8 /* { dg-final { scan-not-hidden "_ZN1SIiEC1ERKi" } } */
10 template <class T>
11 struct S
13   S (const T &);
14   ~S ();
15   T t;
18 template <class T>
19 S<T>::S (const T &x)
21   t = x;
24 template <class T>
25 S<T>::~S ()
29 #pragma GCC visibility push(hidden)
30 struct U
32   S<int> s;
33   U () : s (6) { }
34 } u;
35 #pragma GCC visibility pop