/external/clang/test/CXX/expr/expr.const/ |
D | p2-0x.cpp | 28 constexpr NonConstexpr2(); // expected-note {{here}} 46 constexpr UndefinedConstexpr(); 47 static constexpr int undefinedConstexpr1(); // expected-note {{here}} 55 static constexpr const int &id_ref(const int &n) { in id_ref() 61 constexpr const int *address_of(const int &a) { in address_of() 64 constexpr const int *return_param(int n) { // expected-note {{declared here}} in return_param() 78 constexpr T(const int &r) : in T() 83 constexpr int n = 0; 84 constexpr T t1(n); // ok 85 …constexpr T t2(0); // expected-error {{must be initialized by a constant expression}} expected-not… [all …]
|
D | p5-0x.cpp | 9 constexpr A(int i) : val(i) { } in A() 10 constexpr operator int() const { return val; } in operator int() 11 constexpr operator long() const { return 43; } in operator long() 16 constexpr A a = 42; 23 constexpr OK() {} in OK() 24 constexpr operator int() const { return 8; } in operator int() 25 } constexpr ok; 28 constexpr Explicit() {} in Explicit() 29 constexpr explicit operator int() const { return 4; } // expected-note 4{{here}} in operator int() 30 } constexpr expl; [all …]
|
/external/libcxx/test/support/ |
D | propagate_const_helpers.h | 6 constexpr const int &operator*() const { return i_; } 7 constexpr int &operator*() { return i_; } 8 constexpr const int *get() const { return &i_; } in get() 9 constexpr int *get() { return &i_; } in get() 10 constexpr const int *operator->() const { return &i_; } 11 constexpr int *operator->() { return &i_; } 13 constexpr X(int i) : i_(i) {} in X() 20 constexpr const int &operator*() const { return i_; } 21 constexpr int &operator*() { return i_; } 22 constexpr const int *get() const { return &i_; } in get() [all …]
|
/external/clang/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/ |
D | p1.cpp | 13 constexpr int i1 = 0; 14 constexpr int f1() { return 0; } in f1() 16 constexpr static int mi1 = 0; 19 constexpr int s1::mi2 = 0; 23 constexpr extern int i2; // expected-error {{constexpr variable declaration must be a definition}} 25 constexpr notlit nl1; // expected-error {{constexpr variable cannot have non-literal type 'const no… 27 void f2(constexpr int i) {} // expected-error {{function parameter cannot be constexpr}} in f2() 30 …constexpr int mi1; // expected-error {{non-static data member cannot be constexpr; did you intend … 31 static constexpr int mi2; 37 …mutable constexpr int mi3 = 3; // expected-error-re {{non-static data member cannot be constexpr{{… [all …]
|
D | p3.cpp | 17 constexpr Literal() {} in Literal() 31 constexpr T(); 32 constexpr int f() const; 35 …virtual constexpr int ExplicitlyVirtual() const { return 0; } // expected-error {{virtual function… in ExplicitlyVirtual() 37 …constexpr int ImplicitlyVirtual() const { return 0; } // expected-error {{virtual function cannot … in ImplicitlyVirtual() 39 …virtual constexpr int OutOfLineVirtual() const; // expected-error {{virtual function cannot be con… 42 …constexpr NonLiteral NonLiteralReturn() const { return {}; } // expected-error {{constexpr functio… in NonLiteralReturn() 43 constexpr void VoidReturn() const { return; } in VoidReturn() 47 constexpr ~T(); // expected-error {{destructor cannot be marked constexpr}} 49 constexpr F NonLiteralReturn2; // ok until definition [all …]
|
D | p4.cpp | 17 constexpr Literal() {} in Literal() 25 constexpr S(int, N::C) {} in S() 26 …constexpr S(int, NonLiteral, N::C) {} // expected-error {{constexpr constructor's 2nd parameter ty… in S() 27 …constexpr S(int, NonLiteral = 42) {} // expected-error {{constexpr constructor's 2nd parameter typ… in S() 30 constexpr S() = default; 31 constexpr S(Literal) = delete; 38 …constexpr T() {} // expected-error {{constexpr constructor not allowed in struct with virtual base… in T() 45 …constexpr C() {} // expected-error {{constexpr constructor not allowed in class with virtual base … in C() 51 constexpr U() in U() 62 constexpr V() { in V() [all …]
|
D | p5.cpp | 7 constexpr int f(void *) { return 0; } in f() 8 constexpr int f(...) { return 1; } in f() 9 constexpr int g1() { return f(0); } in g1() 10 constexpr int g2(int n) { return f(n); } in g2() 11 constexpr int g3(int n) { return f(n*0); } in g3() 14 constexpr int c = 5; 15 constexpr int h() { return c; } in h() 17 constexpr int c = 0; 18 constexpr int g4() { return N::h(); } in g4() 31 constexpr int f(bool b) in f() [all …]
|
D | p6.cpp | 17 constexpr Literal() {} in Literal() 27 constexpr int ImplicitlyVirtual() const { return 0; } in ImplicitlyVirtual() 30 constexpr int a = ImplicitVirtualFromDependentBase<S>().ImplicitlyVirtual(); // expected-error {{co… 31 constexpr int b = ImplicitVirtualFromDependentBase<T>().ImplicitlyVirtual(); // ok 32 constexpr int c = ImplicitVirtualFromDependentBase<S>().ImplicitVirtualFromDependentBase<S>::Implic… 35 constexpr R F() const { return 0; } in F() 37 constexpr int d = ConstexprMember<int>().F(); // ok 38 constexpr int e = ConstexprMember<NonLiteral>().F(); // expected-error {{constant expression}} expe… 41 constexpr ConstexprCtor(P...) {} in ConstexprCtor() 43 constexpr ConstexprCtor<> f1() { return {}; } // ok in f1() [all …]
|
D | p9.cpp | 5 constexpr int a = 0; 9 constexpr int *b = &i; 12 constexpr int &c = i; 15 constexpr int (*d)(int) = 0; 20 constexpr int ni1; // expected-error {{default initialization of an object of const type 'const int… 21 constexpr struct C { C(); } ni2; // expected-error {{cannot have non-literal type 'const struct C'}… 22 constexpr double &ni3; // expected-error {{declaration of reference variable 'ni3' requires an init… 24 constexpr int nc1 = i; // expected-error {{constexpr variable 'nc1' must be initialized by a consta… 25 constexpr C nc2 = C(); // expected-error {{cannot have non-literal type 'const C'}} 27 constexpr int &nc3 = f(); // expected-error {{constexpr variable 'nc3' must be initialized by a con… [all …]
|
/external/clang/test/SemaCXX/ |
D | constant-expression-cxx11.cpp | 13 template<typename T> constexpr T id(const T &t) { return t; } in id() 14 template<typename T> constexpr T min(const T &a, const T &b) { in min() 17 template<typename T> constexpr T max(const T &a, const T &b) { in max() 20 template<typename T, size_t N> constexpr T *begin(T (&xs)[N]) { return xs; } in begin() 21 template<typename T, size_t N> constexpr T *end(T (&xs)[N]) { return xs + N; } in end() 24 constexpr int zero() const { return 0; } in zero() 38 constexpr B *p = &d; 39 constexpr C *q = &d; 45 constexpr B &pp = d; 46 constexpr C &qq = d; [all …]
|
D | constant-expression-cxx1y.cpp | 5 constexpr S(int); 11 constexpr int &get(int n) { return arr[n]; } in get() 12 constexpr const int &get(int n) const { return arr[n]; } in get() 20 constexpr int e() {{{{}} return 5; }} in e() 24 constexpr int f() { in f() 28 constexpr S(E e) : e(e) {} in f() 29 constexpr int get() { return e; } in f() 38 constexpr int g(int k) { in g() 45 constexpr int h(int n) { in h() 49 constexpr int i(int n) { in i() [all …]
|
D | constexpr-printing.cpp | 4 constexpr int extract(const S &s); 7 constexpr S() : n(extract(*this)), m(0) {} // expected-note {{in call to 'extract(s1)'}} in S() 8 constexpr S(int k) : n(k), m(extract(*this)) {} in S() 12 constexpr int extract(const S &s) { return s.n; } // expected-note {{read of object outside its lif… in extract() 14 constexpr S s1; // ok 16 constexpr S s1; // expected-error {{constant expression}} expected-note {{in call to 'S()'}} in f() 17 constexpr S s2(10); in f() 23 constexpr T() : arr() {} in T() 27 constexpr U(const int *p) : T(), another(), p(p) {} in U() 28 constexpr U(const U &u) : T(), another(), p(u.p) {} in U() [all …]
|
D | builtin-assume-aligned.cpp | 4 constexpr int *p = 0; 6 constexpr int *k = (int *) __builtin_assume_aligned(p, 16, n = 5); 8 constexpr void *l = __builtin_assume_aligned(p, 16); 12 constexpr int *c = (int *) __builtin_assume_aligned(p, 16); 16 constexpr void *m = __builtin_assume_aligned(&n, 16); 20 constexpr void *q1 = __builtin_assume_aligned(&n, 4, 2); 23 constexpr void *q2 = __builtin_assume_aligned(&n, 4, -2); 24 constexpr void *q3 = __builtin_assume_aligned(&n, 4, 4); 25 constexpr void *q4 = __builtin_assume_aligned(&n, 4, -4); 30 constexpr void *r1 = __builtin_assume_aligned(&ar1[2], 16); [all …]
|
/external/clang/test/CXX/basic/basic.types/ |
D | p10.cpp | 9 constexpr void f() {} in f() 15 constexpr int f1(double) { return 0; } in f1() 19 constexpr int f2(S &) { return 0; } in f2() 24 static constexpr BeingDefined& t = beingdefined; 34 constexpr Incomplete incomplete = {}; // expected-error {{constexpr variable cannot have non-litera… 35 constexpr Incomplete incomplete2[] = {}; // expected-error {{constexpr variable cannot have non-lit… 36 constexpr ClassTemp<int> classtemplate = {}; 37 constexpr ClassTemp<int> classtemplate2[] = {}; 43 constexpr int f(UserProvDtor) { return 0; } // expected-error {{'UserProvDtor' is not a literal typ… in f() 45 constexpr NonTrivDtor(); [all …]
|
/external/clang/test/CodeGenCXX/ |
D | const-init-cxx11.cpp | 9 constexpr U(int x) : x(x) {} in U() 10 constexpr U(const char *y) : y(y) {} in U() 15 constexpr A(int n, double d, int x) : n(n), d(d), u(x) {} in A() 16 constexpr A(int n, double d, const char *y) : n(n), d(d), u(y) {} in A() 20 extern constexpr A a(1, 2.0, 3); 23 extern constexpr A b(4, 5, "hello"); 38 constexpr C() : c(0) {} in C() 46 constexpr D() : d(5) {} in D() 73 struct Test : Ts... { constexpr Test() : Ts()..., n(5) {} int n; }; in Test() 77 extern constexpr Test1 t1 = Test1(); [all …]
|
/external/clang/test/CXX/special/class.copy/ |
D | p13-0x.cpp | 6 constexpr Constexpr1() : n(0) {} in Constexpr1() 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) {} in Constexpr2() 19 constexpr Constexpr2 c2a = Constexpr2(Constexpr2()); // ok 20 constexpr Constexpr2 c2b = Constexpr2(Constexpr2(c2a)); // ok 27 constexpr Constexpr3 c3a = Constexpr3(Constexpr3()); // ok 28 constexpr Constexpr3 c3b = Constexpr3(Constexpr3(c3a)); // ok 31 constexpr NonConstexprCopy() = default; [all …]
|
/external/clang/test/CXX/special/class.inhctor/ |
D | p2.cpp | 15 constexpr A(X<1>) {} in A() 17 explicit constexpr A(X<3>) {} // expected-note 4{{here}} in A() 22 constexpr A a0c { X<0>{} }; // expected-error {{must be initialized by a constant expression}} expe… 23 constexpr A a0ic = { X<0>{} }; // expected-error {{must be initialized by a constant expression}} e… 27 constexpr A a1c { X<1>{} }; 28 constexpr A a1ic = { X<1>{} }; 32 constexpr A a2c { X<2>{} }; // expected-error {{must be initialized by a constant expression}} expe… 33 constexpr A a2ic = { X<2>{} }; // expected-error {{constructor is explicit}} 37 constexpr A a3c { X<3>{} }; 38 constexpr A a3ic = { X<3>{} }; // expected-error {{constructor is explicit}} [all …]
|
/external/skia/src/core/ |
D | SkICCPriv.h | 17 static constexpr size_t kICCHeaderSize = 132; 20 static constexpr size_t kICCTagTableEntrySize = 12; 22 static constexpr uint32_t kRGB_ColorSpace = SkSetFourByteTag('R', 'G', 'B', ' '); 23 static constexpr uint32_t kCMYK_ColorSpace = SkSetFourByteTag('C', 'M', 'Y', 'K'); 24 static constexpr uint32_t kGray_ColorSpace = SkSetFourByteTag('G', 'R', 'A', 'Y'); 25 static constexpr uint32_t kDisplay_Profile = SkSetFourByteTag('m', 'n', 't', 'r'); 26 static constexpr uint32_t kInput_Profile = SkSetFourByteTag('s', 'c', 'n', 'r'); 27 static constexpr uint32_t kOutput_Profile = SkSetFourByteTag('p', 'r', 't', 'r'); 28 static constexpr uint32_t kColorSpace_Profile = SkSetFourByteTag('s', 'p', 'a', 'c'); 29 static constexpr uint32_t kXYZ_PCSSpace = SkSetFourByteTag('X', 'Y', 'Z', ' '); [all …]
|
/external/libcxx/test/std/experimental/utilities/tuple/tuple.apply/ |
D | constexpr_types.pass.cpp | 22 constexpr int f_int_0() { return 1; } in f_int_0() 23 constexpr int f_int_1(int x) { return x; } in f_int_1() 24 constexpr int f_int_2(int x, int y) { return (x + y); } in f_int_2() 28 constexpr A_int_0() {} in A_int_0() 29 constexpr int operator()() const { return 1; } in operator ()() 34 constexpr A_int_1() {} in A_int_1() 35 constexpr int operator()(int x) const { return x; } in operator ()() 40 constexpr A_int_2() {} in A_int_2() 41 constexpr int operator()(int x, int y) const { return (x + y); } in operator ()() 51 constexpr Tuple t{}; in test_0() [all …]
|
/external/libcxx/test/std/utilities/utility/pairs/pairs.pair/ |
D | not_constexpr_cxx11.fail.cpp | 20 constexpr explicit ExplicitT(int x) : value(x) {} in ExplicitT() 21 constexpr explicit ExplicitT(ExplicitT const& o) : value(o.value) {} in ExplicitT() 26 constexpr ImplicitT(int x) : value(x) {} in ImplicitT() 27 constexpr ImplicitT(ImplicitT const& o) : value(o.value) {} in ImplicitT() 35 constexpr int x = 42; in main() 36 constexpr P default_p{}; in main() 37 constexpr P copy_p(default_p); in main() 38 … constexpr P const_U_V(x, x); // expected-error {{must be initialized by a constant expression}} in main() 39 constexpr P U_V(42, 101); // expected-error {{must be initialized by a constant expression}} in main() 43 constexpr std::pair<int, int> other; in main() [all …]
|
/external/clang/test/CXX/drs/ |
D | dr14xx.cpp | 16 constexpr A() {} in A() 18 constexpr A a = A(); 23 constexpr B() = default; 25 constexpr B b = B(); 31 constexpr C c = C(); 33 constexpr void f() { C c; } in f() 46 friend constexpr A::A() noexcept; 47 friend constexpr B::B() noexcept; // expected-error {{follows non-constexpr declaration}} 48 friend constexpr C::C() noexcept; 49 friend constexpr D::D() noexcept; [all …]
|
/external/clang/test/CXX/special/class.ctor/ |
D | p6-0x.cpp | 12 constexpr NonConstexpr1 nc1 = NonConstexpr1(); // ok, does not call constructor 13 constexpr NonConstexpr2 nc2 = NonConstexpr2(); // ok, does not call constructor 14 constexpr NonConstexpr2a nc2a = NonConstexpr2a(); // ok, does not call constructor 15 constexpr int nc2_a = NonConstexpr2().nl.a; // ok 16 constexpr int nc2a_a = NonConstexpr2a().a; // ok 18 …friend constexpr NonConstexpr1::NonConstexpr1(); // expected-error {{follows non-constexpr declara… 19 …friend constexpr NonConstexpr2::NonConstexpr2(); // expected-error {{follows non-constexpr declara… 23 constexpr Constexpr1 c1 = Constexpr1(); // ok 25 constexpr NonConstexpr3 nc3 = NonConstexpr3(); // expected-error {{non-literal type 'const NonConst… 30 constexpr Constexpr2 c2 = Constexpr2(); // ok [all …]
|
/external/clang/test/CXX/stmt.stmt/stmt.select/stmt.if/ |
D | p2.cpp | 10 if constexpr(sizeof...(rs) > 0) in g() 19 if constexpr (true) in f() 31 if constexpr (false) in f() 43 if constexpr (5) {} // expected-error {{cannot be narrowed}} in f() 46 if constexpr (N) {} // expected-error {{cannot be narrowed}} in g() 56 if constexpr (sizeof(T) == 1 && sizeof(x) == 1) in f() 63 if constexpr (sizeof(T) == 1) in g() 64 if constexpr (sizeof(x) == 1) in g() 80 case 4: if constexpr(sizeof(n) == 4) return; in in_switch() 81 if constexpr(sizeof(n) == 4) in in_switch() [all …]
|
/external/clang/test/SemaTemplate/ |
D | constexpr-instantiate.cpp | 5 template<typename T> static constexpr T get() { return T(); } in get() 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; } in consume() 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; } in f() 36 template<typename T> constexpr T f(T n) { return n; } in f() 46 template<typename T> constexpr T f(T t) { return t; } in f() 65 constexpr int m = S<int>::k; // ok [all …]
|
/external/swiftshader/third_party/subzero/src/ |
D | IceAssemblerARM32.cpp | 33 static constexpr IValueT kWordSize = sizeof(WordType); 36 static constexpr IValueT B0 = 1; 37 static constexpr IValueT B1 = 1 << 1; 38 static constexpr IValueT B2 = 1 << 2; 39 static constexpr IValueT B3 = 1 << 3; 40 static constexpr IValueT B4 = 1 << 4; 41 static constexpr IValueT B5 = 1 << 5; 42 static constexpr IValueT B6 = 1 << 6; 43 static constexpr IValueT B7 = 1 << 7; 44 static constexpr IValueT B8 = 1 << 8; [all …]
|