Lines Matching defs:bit_cast
24 constexpr To bit_cast(const From &from) {
40 return bit_cast<Init>(bit_cast<Intermediate>(init)) == init;
53 static_assert(bit_cast<unsigned>(input) == expected);
68 static_assert(bit_cast<unsigned long long>(splice) == (LITTLE_END
72 static_assert(bit_cast<int_splicer>(0xCAFEBABE0C05FEFE).x == (LITTLE_END
100 constexpr tuple4 t4 = bit_cast<tuple4>(b);
104 constexpr auto b2 = bit_cast<bases>(t4);
124 // expected-note@+1 {{in call to 'bit_cast<no_pad, pad>(pir)'}}
125 constexpr int piw = bit_cast<no_pad>(pir).x;
128 // expected-note@+1 {{in call to 'bit_cast<no_pad, pad>(pir)'}}
129 constexpr no_pad bad = bit_cast<no_pad>(pir);
131 constexpr pad fine = bit_cast<pad>(no_pad{1, 2, 3, 4, 5});
147 // expected-note@+1 {{constexpr bit_cast involving bit-field is not yet supported}}
169 constexpr G g = bit_cast<G>(s);
185 // expected-note@+1 {{bit_cast from a union type is not allowed in a constant expression}}
188 // expected-note@+1 {{bit_cast to a union type is not allowed in a constant expression}}
197 // expected-note@+1 {{bit_cast from a pointer type is not allowed in a constant expression}}
200 // expected-note@+1 {{bit_cast to a pointer type is not allowed in a constant expression}}
224 // expected-note@+1 {{bit_cast from a pointer type is not allowed in a constant expression}}
230 constexpr unsigned int i = bit_cast<unsigned int>(a);
281 no_pad np = bit_cast<no_pad>(p);
309 // expected-note@+1 {{bit_cast from a type with a reference member is not allowed in a constant expression}}
318 // expected-note@+1 {{bit_cast from a union type is not allowed in a constant expression}}
333 // expected-note@+1 {{bit_cast from a member pointer type is not allowed in a constant expression}}
341 return bit_cast<B>(a);
353 return bit_cast<A>(b);
411 constexpr bool test_bad_bool = bit_cast<bool>('A'); // expected-error {{must be initialized by a constant expression}} expected-note{{in call}}
423 constexpr __int128_t test_cast_to_int128 = bit_cast<__int128_t>((long double)0); // expected-error{{must be initialized by a constant expression}} expected-note{{in call}}
436 bytes b = bit_cast<bytes>(ld);
464 static_assert(bit_cast<long double>(ld539) == fivehundredandthirtynine, "");
478 static_assert(bit_cast<unsigned long long>(test_vector) == (LITTLE_END
492 static_assert(bit_cast<unsigned char>(bool8{1,0,1,0,1,0,1,0}) == (LITTLE_END ? 0x55 : 0xAA), "");
497 static_assert(bit_cast<unsigned short>(bool16{1,1,1,1,1,0,0,0, 1,1,1,1,0,1,0,0}) == (LITTLE_END ? 0x2F1F : 0xF8F4), "");
504 // expected-note@+1 {{bit_cast involving type 'bool __attribute__((ext_vector_type(9)))' (vector of 9 'bool' values) is not allowed in a constant expression; element size 1 * element count 9 is not a multiple of the byte size 8}}
507 // expected-note@+1 {{bit_cast involving type 'bool __attribute__((ext_vector_type(9)))' (vector of 9 'bool' values) is not allowed in a constant expression; element size 1 * element count 9 is not a multiple of the byte size 8}}
510 // expected-note@+1 {{bit_cast involving type 'bool __attribute__((ext_vector_type(17)))' (vector of 17 'bool' values) is not allowed in a constant expression; element size 1 * element count 17 is not a multiple of the byte size 8}}
518 static_assert(bit_cast<unsigned long long>(test_int_complex) == (LITTLE_END