Home
last modified time | relevance | path

Searched refs:static_assert (Results 1 – 25 of 1096) sorted by relevance

12345678910>>...44

/external/libcxx/test/std/depr/depr.c.headers/
Dstdint_h.pass.cpp24 static_assert(sizeof(int8_t)*CHAR_BIT == 8, in main()
26 static_assert(std::is_signed<int8_t>::value, in main()
29 static_assert(sizeof(int16_t)*CHAR_BIT == 16, in main()
31 static_assert(std::is_signed<int16_t>::value, in main()
34 static_assert(sizeof(int32_t)*CHAR_BIT == 32, in main()
36 static_assert(std::is_signed<int32_t>::value, in main()
39 static_assert(sizeof(int64_t)*CHAR_BIT == 64, in main()
41 static_assert(std::is_signed<int64_t>::value, in main()
45 static_assert(sizeof(uint8_t)*CHAR_BIT == 8, in main()
47 static_assert(std::is_unsigned<uint8_t>::value, in main()
[all …]
Dmath_h.pass.cpp22 static_assert((std::is_same<decltype(acos((double)0)), double>::value), ""); in test_acos()
23 static_assert((std::is_same<decltype(acosf(0)), float>::value), ""); in test_acos()
24 static_assert((std::is_same<decltype(acosl(0)), long double>::value), ""); in test_acos()
30 static_assert((std::is_same<decltype(asin((double)0)), double>::value), ""); in test_asin()
31 static_assert((std::is_same<decltype(asinf(0)), float>::value), ""); in test_asin()
32 static_assert((std::is_same<decltype(asinl(0)), long double>::value), ""); in test_asin()
38 static_assert((std::is_same<decltype(atan((double)0)), double>::value), ""); in test_atan()
39 static_assert((std::is_same<decltype(atanf(0)), float>::value), ""); in test_atan()
40 static_assert((std::is_same<decltype(atanl(0)), long double>::value), ""); in test_atan()
46 static_assert((std::is_same<decltype(atan2((double)0, (double)0)), double>::value), ""); in test_atan2()
[all …]
Dwchar_h.pass.cpp45 static_assert((std::is_same<decltype(fwprintf(fp, L"")), int>::value), ""); in main()
46 static_assert((std::is_same<decltype(fwscanf(fp, L"")), int>::value), ""); in main()
47 static_assert((std::is_same<decltype(swprintf(ws, s, L"")), int>::value), ""); in main()
48 static_assert((std::is_same<decltype(swscanf(L"", L"")), int>::value), ""); in main()
49 static_assert((std::is_same<decltype(vfwprintf(fp, L"", va)), int>::value), ""); in main()
50 static_assert((std::is_same<decltype(vfwscanf(fp, L"", va)), int>::value), ""); in main()
51 static_assert((std::is_same<decltype(vswprintf(ws, s, L"", va)), int>::value), ""); in main()
52 static_assert((std::is_same<decltype(vswscanf(L"", L"", va)), int>::value), ""); in main()
53 static_assert((std::is_same<decltype(vwprintf(L"", va)), int>::value), ""); in main()
54 static_assert((std::is_same<decltype(vwscanf(L"", va)), int>::value), ""); in main()
[all …]
Dstdio_h.pass.cpp90 static_assert((std::is_same<decltype(remove("")), int>::value), ""); in main()
91 static_assert((std::is_same<decltype(rename("","")), int>::value), ""); in main()
92 static_assert((std::is_same<decltype(tmpfile()), FILE*>::value), ""); in main()
93 static_assert((std::is_same<decltype(tmpnam(cp)), char*>::value), ""); in main()
94 static_assert((std::is_same<decltype(fclose(fp)), int>::value), ""); in main()
95 static_assert((std::is_same<decltype(fflush(fp)), int>::value), ""); in main()
96 static_assert((std::is_same<decltype(fopen("", "")), FILE*>::value), ""); in main()
97 static_assert((std::is_same<decltype(freopen("", "", fp)), FILE*>::value), ""); in main()
98 static_assert((std::is_same<decltype(setbuf(fp,cp)), void>::value), ""); in main()
99 static_assert((std::is_same<decltype(vfprintf(fp,"",va)), int>::value), ""); in main()
[all …]
/external/clang/test/SemaCXX/
Dcomplex-folding.cpp5 static_assert((0.0 + 0.0j) == (0.0 + 0.0j));
6 static_assert((0.0 + 0.0j) != (0.0 + 0.0j)); // expected-error {{static_assert}}
8 static_assert((0.0 + 0.0j) == 0.0);
9 static_assert(0.0 == (0.0 + 0.0j));
10 static_assert(0.0 == 0.0j);
11 static_assert((0.0 + 1.0j) != 0.0);
12 static_assert(1.0 != (0.0 + 0.0j));
13 static_assert(0.0 != 1.0j);
17 static_assert((1.0 + 0.0j) == (0.0 + 0.0j)); // expected-error {{static_assert}}
18 static_assert((1.0 + 0.0j) == (1.0 + 0.0j));
[all …]
Dpredefined-expr.cpp6 static_assert(sizeof(__func__) == 4, "foo"); in foo()
7 static_assert(sizeof(__FUNCTION__) == 4, "foo"); in foo()
8 static_assert(sizeof(__PRETTY_FUNCTION__) == 11, "auto foo()"); in foo()
13 static_assert(sizeof(__func__) == 4, "bar"); in bar()
14 static_assert(sizeof(__FUNCTION__) == 4, "bar"); in bar()
15 static_assert(sizeof(__PRETTY_FUNCTION__) == 10, "int bar()"); in bar()
22 static_assert(sizeof(__func__) == 4, "baz"); in baz()
23 static_assert(sizeof(__FUNCTION__) == 4, "baz"); in baz()
24 static_assert(sizeof(__PRETTY_FUNCTION__) == 20, "int baz() [T = int]"); in baz()
27 static_assert(sizeof(__func__) == 11, "operator()"); in baz()
[all …]
Dconstant-expression-cxx1y.cpp17 static_assert(&s.get(4) - &sr.get(2) == 2, "");
21 static_assert(e() == 5, "");
35 static_assert(f() == 1, "");
44 static_assert(g(2) == 42, "");
67 static_assert(j(0) == -3, "");
68 static_assert(j(1) == 5, "");
69 static_assert(j(2), ""); // expected-error {{constant expression}} expected-note {{in call to 'j(2)…
70 static_assert(j(3) == 3, "");
71 static_assert(j(4) == 5, "");
72 static_assert(j(5) == 1, "");
[all …]
Dmember-pointer-ms.cpp89 static_assert(sizeof(int IncSingle::*) == kSingleDataSize, "");
90 static_assert(sizeof(int IncMultiple::*) == kMultipleDataSize, "");
91 static_assert(sizeof(int IncVirtual::*) == kVirtualDataSize, "");
92 static_assert(sizeof(void (IncSingle::*)()) == kSingleFunctionSize, "");
93 static_assert(sizeof(void (IncMultiple::*)()) == kMultipleFunctionSize, "");
94 static_assert(sizeof(void (IncVirtual::*)()) == kVirtualFunctionSize, "");
96 static_assert(__alignof(int IncSingle::*) == kSingleDataAlign, "");
97 static_assert(__alignof(int IncMultiple::*) == kMultipleDataAlign, "");
98 static_assert(__alignof(int IncVirtual::*) == kVirtualDataAlign, "");
99 static_assert(__alignof(void (IncSingle::*)()) == kSingleFunctionAlign, "");
[all …]
Dconstant-expression-cxx11.cpp6 static_assert(++x, "test"); // expected-error {{not an integral constant expression}}
7 static_assert(false, "test"); // expected-error {{test}}
41 static_assert((void*)p != (void*)q, "");
42 static_assert((A*)p == (A*)q, "");
43 static_assert((Aa*)p != (Aa*)q, "");
47 static_assert((void*)&pp != (void*)&qq, "");
48 static_assert(&(A&)pp == &(A&)qq, "");
49 static_assert(&(Aa&)pp != &(Aa&)qq, "");
54 static_assert(v == w, "");
55 static_assert(v == x, "");
[all …]
/external/libcxx/test/std/diagnostics/syserr/
Derrc.pass.cpp18 static_assert(static_cast<int>(std::errc::address_family_not_supported) == EAFNOSUPPORT, ""); in main()
19 static_assert(static_cast<int>(std::errc::address_in_use) == EADDRINUSE, ""); in main()
20 static_assert(static_cast<int>(std::errc::address_not_available) == EADDRNOTAVAIL, ""); in main()
21 static_assert(static_cast<int>(std::errc::already_connected) == EISCONN, ""); in main()
22 static_assert(static_cast<int>(std::errc::argument_list_too_long) == E2BIG, ""); in main()
23 static_assert(static_cast<int>(std::errc::argument_out_of_domain) == EDOM, ""); in main()
24 static_assert(static_cast<int>(std::errc::bad_address) == EFAULT, ""); in main()
25 static_assert(static_cast<int>(std::errc::bad_file_descriptor) == EBADF, ""); in main()
26 static_assert(static_cast<int>(std::errc::bad_message) == EBADMSG, ""); in main()
27 static_assert(static_cast<int>(std::errc::broken_pipe) == EPIPE, ""); in main()
[all …]
/external/libcxx/test/std/numerics/c.math/
Dcmath.pass.cpp105 static_assert((std::is_same<decltype(std::abs((float)0)), float>::value), ""); in test_abs()
106 static_assert((std::is_same<decltype(std::abs((double)0)), double>::value), ""); in test_abs()
107 static_assert((std::is_same<decltype(std::abs((long double)0)), long double>::value), ""); in test_abs()
108 static_assert((std::is_same<decltype(abs(Ambiguous())), Ambiguous>::value), ""); in test_abs()
114 static_assert((std::is_same<decltype(std::acos((float)0)), float>::value), ""); in test_acos()
115 static_assert((std::is_same<decltype(std::acos((bool)0)), double>::value), ""); in test_acos()
116 static_assert((std::is_same<decltype(std::acos((unsigned short)0)), double>::value), ""); in test_acos()
117 static_assert((std::is_same<decltype(std::acos((int)0)), double>::value), ""); in test_acos()
118 static_assert((std::is_same<decltype(std::acos((unsigned int)0)), double>::value), ""); in test_acos()
119 static_assert((std::is_same<decltype(std::acos((long)0)), double>::value), ""); in test_acos()
[all …]
/external/libcxx/test/std/experimental/utilities/meta/meta.type.synop/
Dmeta.unary.prop.pass.cpp42 static_assert(ex::is_const_v<T>, ""); in type_properties_test()
43 static_assert(std::is_same<decltype(ex::is_const_v<T>), const bool>::value, ""); in type_properties_test()
44 static_assert(ex::is_const_v<T> == std::is_const<T>::value, ""); in type_properties_test()
48 static_assert(!ex::is_const_v<T>, ""); in type_properties_test()
49 static_assert(ex::is_const_v<T> == std::is_const<T>::value, ""); in type_properties_test()
53 static_assert(ex::is_volatile_v<T>, ""); in type_properties_test()
54 static_assert(std::is_same<decltype(ex::is_volatile_v<T>), const bool>::value, ""); in type_properties_test()
55 static_assert(ex::is_volatile_v<T> == std::is_volatile<T>::value, ""); in type_properties_test()
59 static_assert(!ex::is_volatile_v<T>, ""); in type_properties_test()
60 static_assert(ex::is_volatile_v<T> == std::is_volatile<T>::value, ""); in type_properties_test()
[all …]
Dmeta.unary.cat.pass.cpp26 static_assert(ex::is_void_v<T>, ""); in main()
27 static_assert(std::is_same<decltype(ex::is_void_v<T>), const bool>::value, ""); in main()
28 static_assert(ex::is_void_v<T> == std::is_void<T>::value, ""); in main()
32 static_assert(!ex::is_void_v<T>, ""); in main()
33 static_assert(ex::is_void_v<T> == std::is_void<T>::value, ""); in main()
37 static_assert(ex::is_null_pointer_v<T>, ""); in main()
38 static_assert(std::is_same<decltype(ex::is_null_pointer_v<T>), const bool>::value, ""); in main()
39 static_assert(ex::is_null_pointer_v<T> == std::is_null_pointer<T>::value, ""); in main()
43 static_assert(!ex::is_null_pointer_v<T>, ""); in main()
44 static_assert(ex::is_null_pointer_v<T> == std::is_null_pointer<T>::value, ""); in main()
[all …]
/external/libcxx/test/std/language.support/cstdint/cstdint.syn/
Dcstdint.pass.cpp25 static_assert(sizeof(std::int8_t)*CHAR_BIT == 8, in main()
27 static_assert(std::is_signed<std::int8_t>::value, in main()
30 static_assert(sizeof(std::int16_t)*CHAR_BIT == 16, in main()
32 static_assert(std::is_signed<std::int16_t>::value, in main()
35 static_assert(sizeof(std::int32_t)*CHAR_BIT == 32, in main()
37 static_assert(std::is_signed<std::int32_t>::value, in main()
40 static_assert(sizeof(std::int64_t)*CHAR_BIT == 64, in main()
42 static_assert(std::is_signed<std::int64_t>::value, in main()
46 static_assert(sizeof(std::uint8_t)*CHAR_BIT == 8, in main()
48 static_assert(std::is_unsigned<std::uint8_t>::value, in main()
[all …]
/external/clang/test/CXX/special/class.copy/
Dp12-0x.cpp6 static_assert(B == __has_trivial_copy(T), "");
7 static_assert(B == __is_trivially_constructible(T, T), "");
8 static_assert(B == __is_trivially_constructible(T, const T &), "");
9 static_assert(B == __is_trivially_constructible(T, T &&), "");
57 static_assert(!__is_trivially_constructible(MutableTemplateCtorMember, const MutableTemplateCtorMem…
58 static_assert(__is_trivially_constructible(MutableTemplateCtorMember, MutableTemplateCtorMember &&)…
64 static_assert(!__is_trivially_constructible(MutableTemplateCtorMember2, const MutableTemplateCtorMe…
65 static_assert(__is_trivially_constructible(MutableTemplateCtorMember2, MutableTemplateCtorMember2 &…
76 static_assert(!__has_trivial_copy(TNT), "lie deliberately for gcc compatibility");
77 static_assert(__is_trivially_constructible(TNT, TNT), "");
[all …]
Dp25-0x.cpp6 static_assert(B == __has_trivial_assign(T), "");
7 static_assert(B == __is_trivially_assignable(T&, T), "");
8 static_assert(B == __is_trivially_assignable(T&, const T &), "");
9 static_assert(B == __is_trivially_assignable(T&, T &&), "");
10 static_assert(B == __is_trivially_assignable(T&&, T), "");
11 static_assert(B == __is_trivially_assignable(T&&, const T &), "");
12 static_assert(B == __is_trivially_assignable(T&&, T &&), "");
58 static_assert(!__is_trivially_assignable(MutableTemplateCtorMember, const MutableTemplateCtorMember…
59 static_assert(__is_trivially_assignable(MutableTemplateCtorMember, MutableTemplateCtorMember &&), "…
70 static_assert(!__has_trivial_assign(TNT), "lie deliberately for gcc compatibility");
[all …]
/external/clang/test/CodeGenCXX/
Daarch64-aapcs-zerolength-bitfield.cpp14 static_assert(offsetof(struct t1, bar) == 1);
15 static_assert(sizeof(struct t1) == 4);
23 static_assert(offsetof(struct t2, bar) == 2);
24 static_assert(sizeof(struct t2) == 4);
32 static_assert(offsetof(struct t3, bar) == 4);
33 static_assert(sizeof(struct t3) == 8);
41 static_assert(offsetof(struct t4, bar) == 8);
42 static_assert(sizeof(struct t4) == 16);
50 static_assert(offsetof(struct t5, bar) == 8);
51 static_assert(sizeof(struct t5) == 16);
[all …]
/external/libcxx/test/std/utilities/meta/meta.trans/meta.trans.other/
Daligned_storage.pass.cpp21 static_assert(std::is_same<std::aligned_storage_t<10, 1>, T1>::value, "" ); in main()
23 static_assert(std::alignment_of<T1>::value == 1, ""); in main()
24 static_assert(sizeof(T1) == 10, ""); in main()
29 static_assert(std::is_same<std::aligned_storage_t<10, 2>, T1>::value, "" ); in main()
31 static_assert(std::alignment_of<T1>::value == 2, ""); in main()
32 static_assert(sizeof(T1) == 10, ""); in main()
37 static_assert(std::is_same<std::aligned_storage_t<10, 4>, T1>::value, "" ); in main()
39 static_assert(std::alignment_of<T1>::value == 4, ""); in main()
40 static_assert(sizeof(T1) == 12, ""); in main()
45 static_assert(std::is_same<std::aligned_storage_t<10, 8>, T1>::value, "" ); in main()
[all …]
/external/clang/test/Headers/
Darm64-apple-ios-types.cpp16 static_assert(is_same<char, char>::value, "is_same is broken");
17 static_assert(!is_same<char, char *>::value, "is_same is broken");
29 static_assert(check_type<bool, 1, 1>::value, "bool is wrong");
31 static_assert(check_type<char, 1, 1>::value, "char is wrong");
32 static_assert(check_type<signed char, 1, 1>::value, "signed char is wrong");
33 static_assert(check_type<unsigned char, 1, 1>::value, "unsigned char is wrong");
35 static_assert(check_type<char16_t, 2, 2>::value, "char16_t is wrong");
36 static_assert(check_type<char32_t, 4, 4>::value, "char32_t is wrong");
37 static_assert(check_type<wchar_t, 4, 4>::value, "wchar_t is wrong");
39 static_assert(check_type<short, 2, 2>::value, "short is wrong");
[all …]
Dthumbv7-apple-ios-types.cpp16 static_assert(is_same<char, char>::value, "is_same is broken");
17 static_assert(!is_same<char, char *>::value, "is_same is broken");
29 static_assert(check_type<bool, 1, 1>::value, "bool is wrong");
31 static_assert(check_type<char, 1, 1>::value, "char is wrong");
32 static_assert(check_type<signed char, 1, 1>::value, "signed char is wrong");
33 static_assert(check_type<unsigned char, 1, 1>::value, "unsigned char is wrong");
35 static_assert(check_type<char16_t, 2, 2>::value, "char16_t is wrong");
36 static_assert(check_type<char32_t, 4, 4>::value, "char32_t is wrong");
37 static_assert(check_type<wchar_t, 4, 4>::value, "wchar_t is wrong");
39 static_assert(check_type<short, 2, 2>::value, "short is wrong");
[all …]
Dx86_64-apple-macosx-types.cpp16 static_assert(is_same<char, char>::value, "is_same is broken");
17 static_assert(!is_same<char, char *>::value, "is_same is broken");
29 static_assert(check_type<bool, 1, 1>::value, "bool is wrong");
31 static_assert(check_type<char, 1, 1>::value, "char is wrong");
32 static_assert(check_type<signed char, 1, 1>::value, "signed char is wrong");
33 static_assert(check_type<unsigned char, 1, 1>::value, "unsigned char is wrong");
35 static_assert(check_type<char16_t, 2, 2>::value, "char16_t is wrong");
36 static_assert(check_type<char32_t, 4, 4>::value, "char32_t is wrong");
37 static_assert(check_type<wchar_t, 4, 4>::value, "wchar_t is wrong");
39 static_assert(check_type<short, 2, 2>::value, "short is wrong");
[all …]
/external/libcxx/test/std/utilities/memory/default.allocator/
Dallocator_pointers.pass.cpp40 static_assert(std::is_same<bool, decltype( vp == vp)>::value, ""); in test_pointer()
41 static_assert(std::is_same<bool, decltype( vp != vp)>::value, ""); in test_pointer()
42 static_assert(std::is_same<bool, decltype( vp > vp)>::value, ""); in test_pointer()
43 static_assert(std::is_same<bool, decltype( vp >= vp)>::value, ""); in test_pointer()
44 static_assert(std::is_same<bool, decltype( vp < vp)>::value, ""); in test_pointer()
45 static_assert(std::is_same<bool, decltype( vp <= vp)>::value, ""); in test_pointer()
47 static_assert(std::is_same<bool, decltype( vp == cvp)>::value, ""); in test_pointer()
48 static_assert(std::is_same<bool, decltype(cvp == vp)>::value, ""); in test_pointer()
49 static_assert(std::is_same<bool, decltype( vp != cvp)>::value, ""); in test_pointer()
50 static_assert(std::is_same<bool, decltype(cvp != vp)>::value, ""); in test_pointer()
[all …]
/external/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.types/
Dallocator_pointers.pass.cpp41 static_assert(std::is_same<bool, decltype( vp == vp)>::value, ""); in test_pointer()
42 static_assert(std::is_same<bool, decltype( vp != vp)>::value, ""); in test_pointer()
43 static_assert(std::is_same<bool, decltype( vp > vp)>::value, ""); in test_pointer()
44 static_assert(std::is_same<bool, decltype( vp >= vp)>::value, ""); in test_pointer()
45 static_assert(std::is_same<bool, decltype( vp < vp)>::value, ""); in test_pointer()
46 static_assert(std::is_same<bool, decltype( vp <= vp)>::value, ""); in test_pointer()
48 static_assert(std::is_same<bool, decltype( vp == cvp)>::value, ""); in test_pointer()
49 static_assert(std::is_same<bool, decltype(cvp == vp)>::value, ""); in test_pointer()
50 static_assert(std::is_same<bool, decltype( vp != cvp)>::value, ""); in test_pointer()
51 static_assert(std::is_same<bool, decltype(cvp != vp)>::value, ""); in test_pointer()
[all …]
/external/libcxx/test/std/strings/c.strings/
Dcwchar.pass.cpp45 static_assert((std::is_same<decltype(std::fwprintf(fp, L"")), int>::value), ""); in main()
46 static_assert((std::is_same<decltype(std::fwscanf(fp, L"")), int>::value), ""); in main()
47 static_assert((std::is_same<decltype(std::swprintf(ws, s, L"")), int>::value), ""); in main()
48 static_assert((std::is_same<decltype(std::swscanf(L"", L"")), int>::value), ""); in main()
49 static_assert((std::is_same<decltype(std::vfwprintf(fp, L"", va)), int>::value), ""); in main()
50 static_assert((std::is_same<decltype(std::vfwscanf(fp, L"", va)), int>::value), ""); in main()
51 static_assert((std::is_same<decltype(std::vswprintf(ws, s, L"", va)), int>::value), ""); in main()
52 static_assert((std::is_same<decltype(std::vswscanf(L"", L"", va)), int>::value), ""); in main()
53 static_assert((std::is_same<decltype(std::vwprintf(L"", va)), int>::value), ""); in main()
54 static_assert((std::is_same<decltype(std::vwscanf(L"", va)), int>::value), ""); in main()
[all …]
/external/clang/test/Frontend/
Dx86_64-nacl-types.cpp7 static_assert(alignof(char) == 1, "alignof char is wrong");
9 static_assert(sizeof(short) == 2, "sizeof short is wrong");
10 static_assert(alignof(short) == 2, "alignof short is wrong");
12 static_assert(sizeof(int) == 4, "sizeof int is wrong");
13 static_assert(alignof(int) == 4, "alignof int is wrong");
15 static_assert(sizeof(long) == 4, "sizeof long is wrong");
16 static_assert(alignof(long) == 4, "alignof long is wrong");
18 static_assert(sizeof(long long) == 8, "sizeof long long is wrong wrong");
19 static_assert(alignof(long long) == 8, "alignof long long is wrong wrong");
21 static_assert(sizeof(void*) == 4, "sizeof void * is wrong");
[all …]

12345678910>>...44