summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp0x/constexpr-array17.C
blob: f722b25ec3d89e01b82c33dffdfa1877fb4c7857 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// PR c++/71092
// { dg-do compile { target c++11 } }

template <typename _Default> struct A { using type = _Default; };
template <typename _Default, template <typename> class>
using __detected_or = A<_Default>;
template <typename _Default, template <typename> class _Op>
using __detected_or_t = typename __detected_or<_Default, _Op>::type;
template <typename _Tp> struct B { typedef _Tp value_type; };
struct C {
  template <typename _Tp> using __pointer = typename _Tp::pointer;
};
template <typename _Alloc> struct J : C {
  using pointer = __detected_or_t<typename _Alloc::value_type *, __pointer>;
};
template <typename _T1> void _Construct(_T1 *) { new _T1; }
struct D {
  template <typename _ForwardIterator, typename _Size>
  static _ForwardIterator __uninit_default_n(_ForwardIterator p1, _Size) {
    _Construct(p1);
    return _ForwardIterator();
  }
};
template <typename _ForwardIterator, typename _Size>
void __uninitialized_default_n(_ForwardIterator p1, _Size) {
  D::__uninit_default_n(p1, 0);
}
template <typename _ForwardIterator, typename _Size, typename _Tp>
void __uninitialized_default_n_a(_ForwardIterator p1, _Size, _Tp) {
  __uninitialized_default_n(p1, 0);
}
template <typename> struct __shared_ptr {
  constexpr __shared_ptr() : _M_ptr(), _M_refcount() {}
  int _M_ptr;
  int _M_refcount;
};
template <typename _Alloc> struct F {
  typedef _Alloc _Tp_alloc_type;
  struct G {
    typename J<_Tp_alloc_type>::pointer _M_start;
    G(_Tp_alloc_type);
  };
  F(int, _Alloc p2) : _M_impl(p2) {}
  G _M_impl;
};
template <typename _Tp, typename _Alloc = B<_Tp>> struct K : F<_Alloc> {
  typedef _Alloc allocator_type;
  K(int, allocator_type p2 = allocator_type()) : F<_Alloc>(0, p2) {
    __uninitialized_default_n_a(this->_M_impl._M_start, 0, 0);
  }
};
struct H {
  H();
  struct I {
    __shared_ptr<int> trigger[1];
  };
  __shared_ptr<int> resetTrigger_;
  K<I> states_;
  __shared_ptr<int> triggerManager_;
};
__shared_ptr<int> a;
H::H() : states_(0), triggerManager_(a) {}