gcc/testsuite/g++.dg/overload/autoptr1.C
raw| 1 | // PR c++/35773 |
| 2 | |
| 3 | template< typename T > |
| 4 | class auto_ptr |
| 5 | { |
| 6 | struct auto_ptr_ref { }; |
| 7 | public: |
| 8 | auto_ptr(auto_ptr&); |
| 9 | auto_ptr(auto_ptr_ref); |
| 10 | |
| 11 | operator auto_ptr_ref(); |
| 12 | }; |
| 13 | |
| 14 | template< typename T > |
| 15 | class reference_wrapper |
| 16 | { |
| 17 | public: |
| 18 | reference_wrapper(T& t); |
| 19 | operator T& () const; |
| 20 | }; |
| 21 | |
| 22 | struct X { }; |
| 23 | |
| 24 | void f(auto_ptr< X >); |
| 25 | |
| 26 | void g(reference_wrapper< auto_ptr< X > > r) |
| 27 | { |
| 28 | f(r); |
| 29 | } |