diff options
Diffstat (limited to 'gcc/testsuite/g++.dg/template/friend19.C')
-rw-r--r-- | gcc/testsuite/g++.dg/template/friend19.C | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/template/friend19.C b/gcc/testsuite/g++.dg/template/friend19.C new file mode 100644 index 000000000..73883b2a0 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/friend19.C @@ -0,0 +1,28 @@ +// { dg-do compile } + +// Origin: Benjamin Li <benxbli@yahoo.com> + +// PR c++/11030: Template substitution of friend class that is +// a specialization. + +template <int S> +struct A +{ + void func(void); +}; + +template <class T> +class C +{ + static void private_func(void) {} +public: + friend class A<512>; +}; + +template <int S> +void A<S>::func(void) +{ + C<void>::private_func(); +} + +template class A<512>; |