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