Lines Matching refs:Constexpr
5 template<typename T> static constexpr T get() { return T(); }
11 constexpr int j = A::get<int>();
13 template<typename T> constexpr int consume(T);
17 template<typename T> constexpr int consume(T) { return 0; }
19 constexpr int l = consume(0);
21 constexpr int m = k; // expected-error {{constant expression}} expected-note {{initializer of 'k'}}
25 template<typename T> constexpr T f(T n) { return n; }
36 template<typename T> constexpr T f(T n) { return n; }
46 template<typename T> constexpr T f(T t) { return t; }
65 constexpr int m = S<int>::k; // ok
66 constexpr int o = n; // expected-error {{constant expression}} expected-note {{initializer of 'n'}}
75 constexpr int n = const_cast<int&>(S<int>::r);
80 // We follow g++ in treating any reference to a constexpr function template
86 // since a lot of classes have constexpr special members in C++11, but the
87 // only observable impact should be the implicit instantiation of constexpr
89 // generated if they are well-formed, and non-constexpr special members in a
90 // base or member cause the class's special member to not be constexpr).
101 decltype(U(U())) u; // ok, don't instantiate S<int>::S() because it wasn't declared constexpr
103 namespace Constexpr {
105 constexpr S() : n(0) {}
106 constexpr S(const S&) : n(T::error) {} // expected-error {{has no members}}
114 template<int x> constexpr int f() { return x; }
121 constexpr bool Integral() {
141 template<class> constexpr int bar() { return 0; }
148 constexpr S1() {}
149 constexpr operator int() const { return 0; }
154 constexpr S2() {}
155 constexpr operator int() const { return 123456; }
161 template <typename> constexpr bool foo() { return true; }
173 static constexpr bool f() { return sizeof(T) < U::size; }
179 struct U { static constexpr int size = 2; };
186 struct duration { constexpr duration() {} };
190 constexpr duration max = duration();
200 template<typename T> constexpr S(T) : n(T::error) {} // expected-error {{no members}}