1 /* { dg-do compile } */
2 /* { dg-options "-c -O3" } */
3 template<typename _Tp> struct A {
5 typedef _Tp& reference;
6 typedef _Tp& const_reference;
7 template<typename>struct rebind
13 template<typename _Alloc>struct __alloc_traits
15 typedef typename _Alloc::pointer pointer;
16 typedef typename _Alloc::reference reference;
17 typedef typename _Alloc::const_reference const_reference;
18 template<typename _Tp>struct rebind
20 typedef typename _Alloc::template rebind<_Tp>::other other;
23 template<typename _Tp, typename _Alloc>struct B
25 typedef typename __alloc_traits<_Alloc>::template rebind<
26 _Tp>::other _Tp_alloc_type;
27 typedef typename __alloc_traits<_Tp_alloc_type>::pointer pointer;
34 template<typename _Tp, typename _Alloc = A<_Tp> >class vec : B<_Tp, _Alloc>{
35 typedef B<_Tp, _Alloc> _Base;
36 typedef typename _Base::_Tp_alloc_type _Tp_alloc_type;
37 typedef __alloc_traits<_Tp_alloc_type> _Alloc_traits;
40 typedef _Tp value_type;
41 typedef typename _Alloc_traits::reference reference;
42 typedef typename _Alloc_traits::const_reference const_reference;
43 reference operator[](int p1)
45 return *(this->_M_impl._M_start + p1);
48 const_reference operator[](long) const;
54 void opModDivGuts(const C&);
55 int mostSetBitP1() const;
57 void C::opModDivGuts(const C& p1)
59 int b = p1.mostSetBitP1(), c = b + 1;
62 for (int i = c; i; i--)
63 a[i] = p1.m_value[i] << b;
65 for (int i = 0; i < c; i++)
66 m_value[i] = d[i] >> b << -b;