]> gcc.gnu.org Git - gcc.git/blame - gcc/testsuite/g++.dg/cpp0x/constexpr-array17.C
PR c++/92590 - wrong handling of inherited default ctor.
[gcc.git] / gcc / testsuite / g++.dg / cpp0x / constexpr-array17.C
CommitLineData
de54de93
JM
1// PR c++/71092
2// { dg-do compile { target c++11 } }
3
4template <typename _Default> struct A { using type = _Default; };
5template <typename _Default, template <typename> class>
6using __detected_or = A<_Default>;
7template <typename _Default, template <typename> class _Op>
8using __detected_or_t = typename __detected_or<_Default, _Op>::type;
9template <typename _Tp> struct B { typedef _Tp value_type; };
10struct C {
11 template <typename _Tp> using __pointer = typename _Tp::pointer;
12};
13template <typename _Alloc> struct J : C {
14 using pointer = __detected_or_t<typename _Alloc::value_type *, __pointer>;
15};
16template <typename _T1> void _Construct(_T1 *) { new _T1; }
17struct D {
18 template <typename _ForwardIterator, typename _Size>
19 static _ForwardIterator __uninit_default_n(_ForwardIterator p1, _Size) {
20 _Construct(p1);
19520957 21 return _ForwardIterator();
de54de93
JM
22 }
23};
24template <typename _ForwardIterator, typename _Size>
25void __uninitialized_default_n(_ForwardIterator p1, _Size) {
26 D::__uninit_default_n(p1, 0);
27}
28template <typename _ForwardIterator, typename _Size, typename _Tp>
29void __uninitialized_default_n_a(_ForwardIterator p1, _Size, _Tp) {
30 __uninitialized_default_n(p1, 0);
31}
32template <typename> struct __shared_ptr {
33 constexpr __shared_ptr() : _M_ptr(), _M_refcount() {}
34 int _M_ptr;
35 int _M_refcount;
36};
37template <typename _Alloc> struct F {
38 typedef _Alloc _Tp_alloc_type;
39 struct G {
40 typename J<_Tp_alloc_type>::pointer _M_start;
41 G(_Tp_alloc_type);
42 };
43 F(int, _Alloc p2) : _M_impl(p2) {}
44 G _M_impl;
45};
46template <typename _Tp, typename _Alloc = B<_Tp>> struct K : F<_Alloc> {
47 typedef _Alloc allocator_type;
48 K(int, allocator_type p2 = allocator_type()) : F<_Alloc>(0, p2) {
49 __uninitialized_default_n_a(this->_M_impl._M_start, 0, 0);
50 }
51};
52struct H {
53 H();
54 struct I {
55 __shared_ptr<int> trigger[1];
56 };
57 __shared_ptr<int> resetTrigger_;
58 K<I> states_;
59 __shared_ptr<int> triggerManager_;
60};
61__shared_ptr<int> a;
62H::H() : states_(0), triggerManager_(a) {}
This page took 2.444438 seconds and 5 git commands to generate.