Home | History | Annotate | Download | only in basic.types

Lines Matching full:constexpr

9 constexpr void f() {}
15 constexpr int f1(double) { return 0; }
19 constexpr int f2(S &) { return 0; }
24 static constexpr BeingDefined& t = beingdefined;
34 constexpr Incomplete incomplete = {}; // expected-error {{constexpr variable cannot have non-literal type 'const Incomplete'}} expected-note {{incomplete type 'const Incomplete' is not a literal type}}
35 constexpr Incomplete incomplete2[] = {}; // expected-error {{constexpr variable cannot have non-literal type 'Incomplete const[]'}} expected-note {{incomplete type 'Incomplete const[]' is not a literal type}}
36 constexpr ClassTemp<int> classtemplate = {};
37 constexpr ClassTemp<int> classtemplate2[] = {};
41 constexpr int f() const; // expected-error {{non-literal type 'UserProvDtor' cannot have constexpr members}}
46 constexpr NonTrivDtor();
47 constexpr int f() const; // expected-error {{non-literal type 'NonTrivDtor' cannot have constexpr members}}
55 constexpr DerivedFromNonTrivDtor();
57 constexpr int f(DerivedFromNonTrivDtor<NonTrivDtorBase>) { return 0; } // expected-error {{constexpr function's 1st parameter type 'DerivedFromNonTrivDtor<NonTrivDtorBase>' is not a literal type}}
59 constexpr TrivDtor();
61 constexpr int f(TrivDtor) { return 0; }
63 constexpr TrivDefaultedDtor();
66 constexpr int f(TrivDefaultedDtor) { return 0; }
68 // - it is an aggregate type or has at least one constexpr constructor or
69 // constexpr constructor template that is not a copy or move constructor
74 constexpr int f3(Agg a) { return a.a; }
76 template<typename T> constexpr CtorTemplate(T);
78 struct CopyCtorOnly { // expected-note {{'CopyCtorOnly' is not literal because it is not an aggregate and has no constexpr constructors other than copy or move constructors}}
79 constexpr CopyCtorOnly(CopyCtorOnly&);
80 constexpr int f() const; // expected-error {{non-literal type 'CopyCtorOnly' cannot have constexpr members}}
82 struct MoveCtorOnly { // expected-note {{no constexpr constructors other than copy or move constructors}}
83 constexpr MoveCtorOnly(MoveCtorOnly&&);
84 constexpr int f() const; // expected-error {{non-literal type 'MoveCtorOnly' cannot have constexpr members}}
88 constexpr CtorArg(T);
90 constexpr int f(CtorArg<int>) { return 0; } // ok
91 constexpr int f(CtorArg<NonLiteral>) { return 0; } // ok, ctor is still constexpr
96 constexpr Derived() {} // expected-error {{constexpr constructor not allowed in struct with virtual base class}}
99 constexpr DerivedFromVBase();
101 constexpr int f(DerivedFromVBase<HasVBase>) {} // expected-error {{constexpr function's 1st parameter type 'DerivedFromVBase<HasVBase>' is not a literal type}}
102 template<typename T> constexpr DerivedFromVBase<T>::DerivedFromVBase() : T() {}
103 constexpr int nVBase = (DerivedFromVBase<HasVBase>(), 0); // expected-error {{constant expression}} expected-note {{cannot construct object of type 'DerivedFromVBase<HasVBase>' with virtual base class in a constant expression}}
109 constexpr int f(NonLitMember) {} // expected-error {{1st parameter type 'NonLitMember' is not a literal type}}
112 constexpr NonLitBase();
113 constexpr int f() const { return 0; } // expected-error {{non-literal type 'NonLitBase' cannot have constexpr members}}
121 constexpr MemberType();
123 constexpr int f(MemberType<int>) { return 0; }
124 constexpr int f(MemberType<NonLiteral>) { return 0; } // expected-error {{not a literal type}}
133 constexpr int f(ArrGood) { return 0; }
138 constexpr int f(ArrBad) { return 0; } // expected-error {{1st parameter type 'ArrBad' is not a literal type}}
140 constexpr int arb(int n) {
141 int a[n]; // expected-error {{variable of non-literal type 'int [n]' cannot be defined in a constexpr function}}