diff options
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.pt/friend10.C')
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.pt/friend10.C | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/friend10.C b/gcc/testsuite/g++.old-deja/g++.pt/friend10.C new file mode 100644 index 000000000..d784eaf47 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/friend10.C @@ -0,0 +1,30 @@ +// { dg-do run } +template <class T> +void f(T); + +template <class U> +class C +{ + template <class T> + friend void f(T) + { + C<U> c; + c.i = 3; + } + +public: + + void g() + { + f(3.0); + } + + int i; +}; + +int main() +{ + f(7); + C<double> c; + c.g(); +} |