gcc/testsuite/g++.old-deja/g++.brendan/cvt4.C
raw| 1 | // { dg-do assemble } |
| 2 | // GROUPS passed conversions |
| 3 | class A {}; |
| 4 | |
| 5 | template <class TP> |
| 6 | class B |
| 7 | { |
| 8 | A &(*_f) (A &, TP); |
| 9 | TP _a; |
| 10 | public: |
| 11 | B (A &(*f) (A &, TP), TP a) : _f (f), _a (a) {} |
| 12 | friend A &operator<< (A &o, const B<TP> &m) |
| 13 | { (*m._f) (o, m._a); return o; } |
| 14 | }; |
| 15 | |
| 16 | A &setw (A &, int); |
| 17 | B<int> setw (int n) |
| 18 | { |
| 19 | return B<int> (setw, n); |
| 20 | } |
| 21 | |
| 22 | A x; |
| 23 | |
| 24 | void f () |
| 25 | { |
| 26 | x << setw (2); |
| 27 | } |