256#if GCC_VERSION >= 5003 || defined __clang__
263typedef unsigned int uns;
267#
if GCC_VERSION >= 5003 || defined __clang__
282#
if GCC_VERSION >= 4009 || defined __clang__
334# pragma GCC diagnostic
push
335# pragma GCC diagnostic ignored
"-Wenum-compare"
340# pragma GCC diagnostic pop
408 constexpr test_flags
f;
415 test_flags
f (FLAG1);
417 SELF_CHECK (
f == FLAG1);
426 constexpr test_flags zero1 = 0;
427 constexpr test_flags zero2 (0);
428 constexpr test_flags zero3 {0};
429 constexpr test_flags zero4 = {0};
445 constexpr test_flags src = FLAG1;
447 constexpr test_flags f1 = src;
448 constexpr test_flags f2 (src);
449 constexpr test_flags f3 {src};
450 constexpr test_flags f4 = {src};
460 test_flags src = FLAG1;
463 dst = std::move (src);
464 SELF_CHECK (dst == FLAG1);
472 constexpr test_flags
f = FLAG1 | FLAG2;
481 SELF_CHECK (
f == (FLAG1 | FLAG2));
484 SELF_CHECK (
f == (FLAG1 | FLAG2));
492 constexpr int some_bits (FLAG1 | FLAG2);
503 test_flags
f = FLAG1;
505 SELF_CHECK (
f == (FLAG1 | FLAG2));
508 test_flags
f = FLAG1;
510 SELF_CHECK (
f == (FLAG1 | FLAG2));
513 test_flags
f = FLAG1;
515 SELF_CHECK (
f == (FLAG1 | FLAG2));
520 test_flags
f = FLAG1 & FLAG2;
525 SELF_CHECK (
f == FLAG2);
529 SELF_CHECK (
f == FLAG2);
533 SELF_CHECK (
f == FLAG2);
538 constexpr test_flags
f = FLAG1 ^ FLAG2;
543 test_flags
f = FLAG1 ^ FLAG2;
545 SELF_CHECK (
f == (FLAG1 | FLAG2 | FLAG3));
547 SELF_CHECK (
f == (FLAG1 | FLAG2));
549 SELF_CHECK (
f == (FLAG1 | FLAG2 | FLAG3));
555 constexpr test_uflags f1 = ~UFLAG1;
556 constexpr test_uflags f2 = ~f1;
564 constexpr test_flags f1 =
true ? FLAG1 : FLAG2;
566 constexpr test_flags f2 =
false ? FLAG1 : FLAG2;
572 constexpr test_flags src = FLAG1;
573 constexpr test_flags f1 =
true ? src : FLAG2;
575 constexpr test_flags f2 =
false ? src : FLAG2;
581 constexpr test_flags src1 = FLAG1;
582 constexpr test_flags src2 = FLAG2;
583 constexpr test_flags f1 =
true ? src1 : src2;
585 constexpr test_flags f2 =
false ? src1 : src2;
594 test_flags
f = FLAG1 | FLAG2;
618 ==
"0x5 [UFLAG1 UFLAG3]");
620 ==
"0x7 [UFLAG1 UFLAG3 0x2]");
626 ==
"0xf [UFLAG1 UFLAG3 0xa]");
633 ==
"0x5 [FLAG1 FLAG3]");
635 ==
"0x7 [FLAG1 FLAG3 0x2]");
639 ==
"0xf [FLAG1 FLAG3 0xa]");