[Patch SRA] Fix PR66119 by calling get_move_ratio in SRA
[official-gcc.git] / gcc / testsuite / g++.dg / pr55263.C
blob5ea863f1ae7a4de6439c87cbfd24d6539ed541ce
1 /* { dg-do compile } */
2 /* { dg-options "-c -O -fgcse-after-reload -fnon-call-exceptions" } */
3 template < typename _Tp > class new_allocator
5 public:
6   typedef _Tp pointer;
7   template < typename _Tp1 > struct rebind
8   {
9     typedef new_allocator < _Tp1 > other;
10   };
14 template < typename > class allocator;
16 template < typename _Alloc > struct __alloc_traits
18   typedef typename _Alloc::pointer pointer;
19     template < typename _Tp > struct rebind
20   {
21     typedef typename _Alloc::template rebind < _Tp >::other other;
22   };
26 template < typename _Tp, typename _Alloc > struct _Vector_base
28   typedef
29     typename
30     __alloc_traits < _Alloc >::template rebind < _Tp >::other _Tp_alloc_type;
31   typedef typename __alloc_traits < _Tp_alloc_type >::pointer pointer;
32   struct _Vector_impl
33   {
34     pointer _M_start;
35     pointer _M_end_of_storage;
36   };
38    ~_Vector_base ();
39   _Vector_impl _M_impl;
42 template < typename _Tp, typename _Alloc = allocator < _Tp > >class vector:
43 _Vector_base < _Tp, _Alloc >
45   typedef _Vector_base < _Tp, _Alloc > _Base;
46 public:
47   typedef typename _Base::pointer pointer;
48 vector ():
49   _Base ()
50   {
51     _M_erase_at_end (this->_M_impl._M_start);
52   }
53   void _M_erase_at_end (pointer)
54   {
55   }
58 template < typename T > class clear_alloc:
59 public new_allocator < T >
63 void
64 foo ()
66   new vector < int, clear_alloc < int > >;