gcc/testsuite/g++.old-deja/g++.ns/template3.C
raw| 1 | // { dg-do run } |
| 2 | //Check instantiation of templates outside their namespace |
| 3 | namespace A{ |
| 4 | template <class T>void g(){} |
| 5 | template <class T> struct B { |
| 6 | B(){ |
| 7 | f(); |
| 8 | } |
| 9 | void f() |
| 10 | { |
| 11 | g<T>(); |
| 12 | } |
| 13 | }; |
| 14 | } |
| 15 | |
| 16 | template class A::B<int>; |
| 17 | A::B<int> s; |
| 18 | |
| 19 | int main() |
| 20 | { |
| 21 | return 0; |
| 22 | } |