/external/clang/test/CodeCompletion/ |
constexpr.cpp | 3 // PR14381: need constexpr function bodies always, even if code-completing. 8 constexpr int f() {
|
/external/clang/test/CXX/special/class.inhctor/ |
p2.cpp | 9 // - absence or presence of constexpr 12 constexpr A(X<1>) {} 14 explicit constexpr A(X<3>) {} // expected-note 2{{here}} 19 constexpr A a0c { X<0>{} }; // expected-error {{must be initialized by a constant expression}} expected-note {{non-constexpr}} 20 constexpr A a0ic = { X<0>{} }; // expected-error {{must be initialized by a constant expression}} expected-note {{non-constexpr}} 24 constexpr A a1c { X<1>{} }; 25 constexpr A a1ic = { X<1>{} }; 29 constexpr A a2c { X<2>{} }; // expected-error {{must be initialized by a constant expression}} expected-note (…) [all...] |
p8.cpp | 4 constexpr A(const int&) : rval(false) {} 5 constexpr A(const int&&) : rval(true) {} 12 constexpr int k = 0; 13 constexpr A a0{0}; 14 constexpr A a1{k}; 15 constexpr B b0{0}; 18 constexpr B b1{k}; 23 template<typename T> constexpr C(T t) : v(t) {} 32 template<typename T> constexpr D::D(T t) : C(t) {} // expected-error {{definition of implicitly declared function}}
|
/external/clang/test/CXX/special/class.ctor/ |
p6-0x.cpp | 3 // Implicitly-defined default constructors are constexpr if the implicit 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 declaration}} 19 friend constexpr NonConstexpr2::NonConstexpr2(); // expected-error {{follows non-constexpr declaration} [all...] |
/external/clang/test/CXX/special/class.copy/ |
p13-0x.cpp | 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 cto [all...] |
/external/clang/test/CXX/dcl.dcl/dcl.spec/dcl.constexpr/ |
p4.cpp | 12 struct NonLiteral { // expected-note 2{{no constexpr constructors}} 17 constexpr Literal() {} 22 // In the definition of a constexpr constructor, each of the parameter types 25 constexpr S(int, N::C) {} 26 constexpr S(int, NonLiteral, N::C) {} // expected-error {{constexpr constructor's 2nd parameter type 'NonLiteral' is not a literal type}} 27 constexpr S(int, NonLiteral = 42) {} // expected-error {{constexpr constructor's 2nd parameter type 'NonLiteral' is not a literal type}} 30 constexpr S() = default; 31 constexpr S(Literal) = delete [all...] |
p5.cpp | 2 // RUN: %clang_cc1 -fsyntax-only -triple x86_64-unknown-unknown -std=c++11 -fcxx-exceptions -Wno-invalid-constexpr %s -DNO_INVALID_CONSTEXPR 6 constexpr int f(void *) { return 0; } 7 constexpr int f(...) { return 1; } 8 constexpr int g1() { return f(0); } 9 constexpr int g2(int n) { return f(n); } 10 constexpr int g3(int n) { return f(n*0); } 13 constexpr int c = 5; 14 constexpr int h() { return c; } 16 constexpr int c = 0; 17 constexpr int g4() { return N::h(); [all...] |
/external/clang/test/PCH/ |
cxx11-constexpr.cpp | 10 constexpr B(char) {} 19 constexpr D(int n) : B('x'), k(2*n+1) {} 23 constexpr int value = 7; 26 constexpr T plus_seven(T other) { 33 constexpr int f(C c) { return 0; } // expected-error {{not a literal type}} 34 // expected-note@13 {{not an aggregate and has no constexpr constructors}} 35 constexpr B b; // expected-error {{constant expression}} expected-note {{non-constexpr}}
|
/prebuilts/gcc/linux-x86/host/i686-linux-glibc2.7-4.6/i686-linux/include/c++/4.6.x-google/bits/ |
regex_error.h | 63 static constexpr error_type error_collate(_S_error_collate); 66 static constexpr error_type error_ctype(_S_error_ctype); 72 static constexpr error_type error_escape(_S_error_escape); 75 static constexpr error_type error_backref(_S_error_backref); 78 static constexpr error_type error_brack(_S_error_brack); 81 static constexpr error_type error_paren(_S_error_paren); 84 static constexpr error_type error_brace(_S_error_brace); 87 static constexpr error_type error_badbrace(_S_error_badbrace); 93 static constexpr error_type error_range(_S_error_range); 99 static constexpr error_type error_space(_S_error_space) [all...] |
/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6/x86_64-linux/include/c++/4.6.x-google/bits/ |
regex_error.h | 63 static constexpr error_type error_collate(_S_error_collate); 66 static constexpr error_type error_ctype(_S_error_ctype); 72 static constexpr error_type error_escape(_S_error_escape); 75 static constexpr error_type error_backref(_S_error_backref); 78 static constexpr error_type error_brack(_S_error_brack); 81 static constexpr error_type error_paren(_S_error_paren); 84 static constexpr error_type error_brace(_S_error_brace); 87 static constexpr error_type error_badbrace(_S_error_badbrace); 93 static constexpr error_type error_range(_S_error_range); 99 static constexpr error_type error_space(_S_error_space) [all...] |
/prebuilts/ndk/8/sources/cxx-stl/gnu-libstdc++/4.6/include/bits/ |
regex_error.h | 63 static constexpr error_type error_collate(_S_error_collate); 66 static constexpr error_type error_ctype(_S_error_ctype); 72 static constexpr error_type error_escape(_S_error_escape); 75 static constexpr error_type error_backref(_S_error_backref); 78 static constexpr error_type error_brack(_S_error_brack); 81 static constexpr error_type error_paren(_S_error_paren); 84 static constexpr error_type error_brace(_S_error_brace); 87 static constexpr error_type error_badbrace(_S_error_badbrace); 93 static constexpr error_type error_range(_S_error_range); 99 static constexpr error_type error_space(_S_error_space) [all...] |
/prebuilts/ndk/8/sources/cxx-stl/gnu-libstdc++/4.7/include/bits/ |
regex_error.h | 63 static constexpr error_type error_collate(_S_error_collate); 66 static constexpr error_type error_ctype(_S_error_ctype); 72 static constexpr error_type error_escape(_S_error_escape); 75 static constexpr error_type error_backref(_S_error_backref); 78 static constexpr error_type error_brack(_S_error_brack); 81 static constexpr error_type error_paren(_S_error_paren); 84 static constexpr error_type error_brace(_S_error_brace); 87 static constexpr error_type error_badbrace(_S_error_badbrace); 93 static constexpr error_type error_range(_S_error_range); 99 static constexpr error_type error_space(_S_error_space) [all...] |
/prebuilts/ndk/9/sources/cxx-stl/gnu-libstdc++/4.6/include/bits/ |
regex_error.h | 63 static constexpr error_type error_collate(_S_error_collate); 66 static constexpr error_type error_ctype(_S_error_ctype); 72 static constexpr error_type error_escape(_S_error_escape); 75 static constexpr error_type error_backref(_S_error_backref); 78 static constexpr error_type error_brack(_S_error_brack); 81 static constexpr error_type error_paren(_S_error_paren); 84 static constexpr error_type error_brace(_S_error_brace); 87 static constexpr error_type error_badbrace(_S_error_badbrace); 93 static constexpr error_type error_range(_S_error_range); 99 static constexpr error_type error_space(_S_error_space) [all...] |
/prebuilts/ndk/9/sources/cxx-stl/gnu-libstdc++/4.7/include/bits/ |
regex_error.h | 63 static constexpr error_type error_collate(_S_error_collate); 66 static constexpr error_type error_ctype(_S_error_ctype); 72 static constexpr error_type error_escape(_S_error_escape); 75 static constexpr error_type error_backref(_S_error_backref); 78 static constexpr error_type error_brack(_S_error_brack); 81 static constexpr error_type error_paren(_S_error_paren); 84 static constexpr error_type error_brace(_S_error_brace); 87 static constexpr error_type error_badbrace(_S_error_badbrace); 93 static constexpr error_type error_range(_S_error_range); 99 static constexpr error_type error_space(_S_error_space) [all...] |
/prebuilts/ndk/9/sources/cxx-stl/gnu-libstdc++/4.8/include/bits/ |
regex_error.h | 68 constexpr error_type error_collate(_S_error_collate); 71 constexpr error_type error_ctype(_S_error_ctype); 77 constexpr error_type error_escape(_S_error_escape); 80 constexpr error_type error_backref(_S_error_backref); 83 constexpr error_type error_brack(_S_error_brack); 86 constexpr error_type error_paren(_S_error_paren); 89 constexpr error_type error_brace(_S_error_brace); 92 constexpr error_type error_badbrace(_S_error_badbrace); 98 constexpr error_type error_range(_S_error_range); 104 constexpr error_type error_space(_S_error_space) [all...] |
/external/clang/test/SemaCXX/ |
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)'}} 8 constexpr S(int k) : n(k), m(extract(*this)) {} 12 constexpr int extract(const S &s) { return s.n; } // expected-note {{read of object outside its lifetime is not allowed in a constant expression}} 14 constexpr S s1; // ok 16 constexpr S s1; // expected-error {{constant expression}} expected-note {{in call to 'S()'}} 17 constexpr S s2(10); 23 constexpr T() : arr() {} 27 constexpr U(const int *p) : T(), another(), p(p) {} 28 constexpr U(const U &u) : T(), another(), p(u.p) { [all...] |
constexpr-strlen.cpp | 9 # 10 "SemaCXX/constexpr-strlen.cpp" 2 10 constexpr int n = __builtin_strlen("hello"); // ok 11 constexpr int m = strlen("hello"); // expected-error {{constant expression}} expected-note {{non-constexpr function 'strlen' cannot be used in a constant expression}}
|
constexpr-backtrace-limit.cpp | 33 constexpr int recurse(int n) { return n ? recurse(n-1) : *(int*)n; }
|
cxx1y-initializer-aggregates.cpp | 5 constexpr U u1 = U(); 6 constexpr U u2 {}; 7 constexpr U u3 { 'x' }; 20 constexpr A a1 {}; 21 constexpr A a2 { 8 }; 22 constexpr A a3 { 1, 2, { 3 } }; 23 constexpr A a4 { 1, 2, { .d = 3.0 } }; 33 constexpr int f() { return n * 5; } 37 constexpr B b2 { 2 }; 55 constexpr B(int k) : d(1.23), k(k) { [all...] |
constant-expression-cxx11.cpp | 13 template<typename T> constexpr T id(const T &t) { return t; } 14 template<typename T> constexpr T min(const T &a, const T &b) { 17 template<typename T> constexpr T max(const T &a, const T &b) { 20 template<typename T, size_t N> constexpr T *begin(T (&xs)[N]) { return xs; } 21 template<typename T, size_t N> constexpr T *end(T (&xs)[N]) { return xs + N; } 24 constexpr int zero() const { return 0; } 38 constexpr B *p = &d; 39 constexpr C *q = &d; 45 constexpr B &pp = d; 46 constexpr C &qq = d [all...] |
/external/clang/test/CodeGenCXX/ |
const-init-cxx11.cpp | 9 constexpr U(int x) : x(x) {} 10 constexpr U(const char *y) : y(y) {} 15 constexpr A(int n, double d, int x) : n(n), d(d), u(x) {} 16 constexpr A(int n, double d, const char *y) : n(n), d(d), u(y) {} 20 extern constexpr A a(1, 2.0, 3); 23 extern constexpr A b(4, 5, "hello"); 38 constexpr C() : c(0) {} 46 constexpr D() : d(5) {} 73 struct Test : Ts... { constexpr Test() : Ts()..., n(5) {} int n; }; 77 extern constexpr Test1 t1 = Test1() [all...] |
/external/clang/test/CXX/stmt.stmt/stmt.select/stmt.switch/ |
p2-0x.cpp | 5 constexpr Value(int n) : n(n) {} 6 constexpr operator short() const { return n; } 11 constexpr operator E() const { return E0; } 14 constexpr short s = Alt();
|
/ndk/sources/cxx-stl/llvm-libc++/libcxx/test/thread/thread.mutex/thread.once/thread.once.onceflag/ |
default.pass.cpp | 14 // constexpr once_flag() noexcept; 25 constexpr std::once_flag f;
|
/external/clang/test/CXX/dcl.decl/dcl.fct.def/dcl.fct.def.default/ |
p2.cpp | 3 // An explicitly-defaulted function may be declared constexpr only if it would 4 // have been implicitly declared as constexpr. 6 constexpr S1() = default; // expected-error {{defaulted definition of default constructor is not constexpr}} 7 constexpr S1(const S1&) = default; 8 constexpr S1(S1&&) = default; 9 constexpr S1 &operator=(const S1&) const = default; // expected-error {{explicitly-defaulted copy assignment operator may not have}} 10 constexpr S1 &operator=(S1&&) const = default; // expected-error {{explicitly-defaulted move assignment operator may not have}} 11 constexpr ~S1() = default; // expected-error {{destructor cannot be marked constexpr}} [all...] |
/external/clang/test/CXX/lex/lex.literal/lex.ext/ |
p8.cpp | 4 constexpr const char *operator "" _id(const char *p, size_t) { return p; } 5 constexpr const char *s = "foo"_id "bar" "baz"_id "quux"; 7 constexpr bool streq(const char *p, const char *q) { 12 constexpr const char *operator "" _trim(const char *p, size_t n) { 15 constexpr const char *t = " " " "_trim " foo";
|