Home | History | Annotate | Download | only in class.copy

Lines Matching refs:constexpr

4 // constexpr constructor, the implicitly-defined constructor is constexpr.
6 constexpr Constexpr1() : n(0) {}
9 constexpr Constexpr1 c1a = Constexpr1(Constexpr1()); // ok
10 constexpr Constexpr1 c1b = Constexpr1(Constexpr1(c1a)); // ok
14 constexpr Constexpr2() = default;
15 constexpr Constexpr2(const Constexpr2 &o) : ce1(o.ce1) {}
19 constexpr Constexpr2 c2a = Constexpr2(Constexpr2()); // ok
20 constexpr Constexpr2 c2b = Constexpr2(Constexpr2(c2a)); // ok
24 // all special constructors are constexpr, move ctor calls ce2's copy ctor
27 constexpr Constexpr3 c3a = Constexpr3(Constexpr3()); // ok
28 constexpr Constexpr3 c3b = Constexpr3(Constexpr3(c3a)); // ok
31 constexpr NonConstexprCopy() = default;
33 constexpr NonConstexprCopy(NonConstexprCopy &&) = default;
40 constexpr NonConstexprCopy ncc1 = NonConstexprCopy(NonConstexprCopy()); // ok
41 constexpr NonConstexprCopy ncc2 = ncc1; // expected-error {{constant expression}} expected-note {{non-constexpr constructor}}
45 constexpr NonConstexprDefault(int n) : n(n) {}
52 constexpr NonConstexprDefault ncd = NonConstexprDefault(NonConstexprDefault(1));
53 constexpr Constexpr4 c4a = { ncd };
54 constexpr Constexpr4 c4b = Constexpr4(c4a);
55 constexpr Constexpr4 c4c = Constexpr4(static_cast<Constexpr4&&>(const_cast<Constexpr4&>(c4b)));
58 struct Constexpr5 : Constexpr5Base { constexpr Constexpr5() {} };
59 constexpr Constexpr5 ce5move = Constexpr5();
60 constexpr Constexpr5 ce5copy = ce5move;
62 // An explicitly-defaulted constructor doesn't become constexpr until the end of
63 // its class. Make sure we note that the class has a constexpr constructor when
97 friend constexpr U::U() noexcept;
98 friend constexpr U::U(U&&) noexcept;
99 friend constexpr U::U(const U&) noexcept;
100 friend constexpr V::V(); // expected-error {{follows non-constexpr declaration}}
101 friend constexpr V::V(V&&) noexcept;
102 friend constexpr V::V(const V&) noexcept;
103 friend constexpr W::W(); // expected-error {{follows non-constexpr declaration}}
104 friend constexpr W::W(W&&) noexcept;
105 friend constexpr W::W(const W&) noexcept;
106 friend constexpr S<U>::S() noexcept;
107 friend constexpr S<U>::S(S<U>&&) noexcept;
108 friend constexpr S<U>::S(const S<U>&) noexcept;
109 friend constexpr S<V>::S(); // expected-error {{follows non-constexpr declaration}}
110 friend constexpr S<V>::S(S<V>&&) noexcept;
111 friend constexpr S<V>::S(const S<V>&) noexcept;
112 friend constexpr S<W>::S(); // expected-error {{follows non-constexpr declaration}}
113 friend constexpr S<W>::S(S<W>&&) noexcept;
114 friend constexpr S<W>::S(const S<W>&) noexcept;