diff options
Diffstat (limited to 'gdb/unittests/enum-flags-selftests.c')
-rw-r--r-- | gdb/unittests/enum-flags-selftests.c | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/gdb/unittests/enum-flags-selftests.c b/gdb/unittests/enum-flags-selftests.c index dddb1e2..f192da3 100644 --- a/gdb/unittests/enum-flags-selftests.c +++ b/gdb/unittests/enum-flags-selftests.c @@ -235,33 +235,6 @@ CHECK_VALID (true, UnsignedEnumFlag, ~UnsignedEnumFlag ()) CHECK_VALID (true, EnumFlag, true ? EnumFlag () : RawEnum ()) CHECK_VALID (true, EnumFlag, true ? RawEnum () : EnumFlag ()) -/* These are valid, but it's not a big deal since you won't be able to - assign the resulting integer to an enum or an enum_flags without a - cast. - - The latter two tests are disabled on older GCCs because they - incorrectly fail with gcc 4.8 and 4.9 at least. Running the test - outside a SFINAE context shows: - - invalid user-defined conversion from ‘EF’ to ‘RE2’ - - They've been confirmed to compile/pass with gcc 5.3, gcc 7.1 and - clang 3.7. */ - -CHECK_VALID (true, int, true ? EnumFlag () : EnumFlag2 ()) -CHECK_VALID (true, int, true ? EnumFlag2 () : EnumFlag ()) -CHECK_VALID (true, int, true ? EnumFlag () : RawEnum2 ()) -CHECK_VALID (true, int, true ? RawEnum2 () : EnumFlag ()) - -/* Same, but with an unsigned enum. */ - -using uns = unsigned int; - -CHECK_VALID (true, uns, true ? EnumFlag () : UnsignedEnumFlag ()) -CHECK_VALID (true, uns, true ? UnsignedEnumFlag () : EnumFlag ()) -CHECK_VALID (true, uns, true ? EnumFlag () : UnsignedRawEnum ()) -CHECK_VALID (true, uns, true ? UnsignedRawEnum () : EnumFlag ()) - /* Unfortunately this can't work due to the way C++ computes the return type of the ternary conditional operator. int isn't implicitly convertible to the raw enum type, so the type of the |