diff options
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.ns/template3.C')
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.ns/template3.C | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.ns/template3.C b/gcc/testsuite/g++.old-deja/g++.ns/template3.C new file mode 100644 index 000000000..d6b51a91d --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.ns/template3.C @@ -0,0 +1,22 @@ +// { dg-do run } +//Check instantiation of templates outside their namespace +namespace A{ +template <class T>void g(){} +template <class T> struct B { + B(){ + f(); + } + void f() + { + g<T>(); + } +}; +} + +template class A::B<int>; +A::B<int> s; + +int main() +{ + return 0; +} |