/* So that std::vectors of types that have enum_flags fields can
reallocate efficiently memcpy. */
-gdb_static_assert (std::is_trivially_copyable<EF>::value);
+static_assert (std::is_trivially_copyable<EF>::value);
#endif
{
constexpr test_flags f;
- gdb_static_assert (f == 0);
+ static_assert (f == 0);
}
/* Check that assignment from zero works. */
constexpr test_flags zero3 {0};
constexpr test_flags zero4 = {0};
- gdb_static_assert (zero1 == 0);
- gdb_static_assert (zero2 == 0);
- gdb_static_assert (zero3 == 0);
- gdb_static_assert (zero4 == 0);
+ static_assert (zero1 == 0);
+ static_assert (zero2 == 0);
+ static_assert (zero3 == 0);
+ static_assert (zero4 == 0);
}
/* Check construction from enum value. */
{
- gdb_static_assert (test_flags (FLAG1) == FLAG1);
- gdb_static_assert (test_flags (FLAG2) != FLAG1);
+ static_assert (test_flags (FLAG1) == FLAG1);
+ static_assert (test_flags (FLAG2) != FLAG1);
}
/* Check copy/assignment. */
constexpr test_flags f3 {src};
constexpr test_flags f4 = {src};
- gdb_static_assert (f1 == FLAG1);
- gdb_static_assert (f2 == FLAG1);
- gdb_static_assert (f3 == FLAG1);
- gdb_static_assert (f4 == FLAG1);
+ static_assert (f1 == FLAG1);
+ static_assert (f2 == FLAG1);
+ static_assert (f3 == FLAG1);
+ static_assert (f4 == FLAG1);
}
/* Check moving. */
to test_flags would fail. */
{
constexpr test_flags f = FLAG1 | FLAG2;
- gdb_static_assert (f == (FLAG1 | FLAG2));
+ static_assert (f == (FLAG1 | FLAG2));
}
/* Similarly, check that "FLAG1 | FLAG2" on the rhs of an assignment
constexpr int some_bits (FLAG1 | FLAG2);
/* And comparison with int works too. */
- gdb_static_assert (some_bits == (FLAG1 | FLAG2));
- gdb_static_assert (some_bits == test_flags (FLAG1 | FLAG2));
+ static_assert (some_bits == (FLAG1 | FLAG2));
+ static_assert (some_bits == test_flags (FLAG1 | FLAG2));
}
/* Check operator| and operator|=. Particularly interesting is
/* Check the ^/^= operators. */
{
constexpr test_flags f = FLAG1 ^ FLAG2;
- gdb_static_assert (f == (FLAG1 ^ FLAG2));
+ static_assert (f == (FLAG1 ^ FLAG2));
}
{
{
constexpr test_uflags f1 = ~UFLAG1;
constexpr test_uflags f2 = ~f1;
- gdb_static_assert (f2 == UFLAG1);
+ static_assert (f2 == UFLAG1);
}
/* Check the ternary operator. */
{
/* raw enum, raw enum */
constexpr test_flags f1 = true ? FLAG1 : FLAG2;
- gdb_static_assert (f1 == FLAG1);
+ static_assert (f1 == FLAG1);
constexpr test_flags f2 = false ? FLAG1 : FLAG2;
- gdb_static_assert (f2 == FLAG2);
+ static_assert (f2 == FLAG2);
}
{
/* enum flags, raw enum */
constexpr test_flags src = FLAG1;
constexpr test_flags f1 = true ? src : FLAG2;
- gdb_static_assert (f1 == FLAG1);
+ static_assert (f1 == FLAG1);
constexpr test_flags f2 = false ? src : FLAG2;
- gdb_static_assert (f2 == FLAG2);
+ static_assert (f2 == FLAG2);
}
{
constexpr test_flags src1 = FLAG1;
constexpr test_flags src2 = FLAG2;
constexpr test_flags f1 = true ? src1 : src2;
- gdb_static_assert (f1 == src1);
+ static_assert (f1 == src1);
constexpr test_flags f2 = false ? src1 : src2;
- gdb_static_assert (f2 == src2);
+ static_assert (f2 == src2);
}
/* Check that we can use flags in switch expressions (requires