[Bug gdb/31331] Wenum-constexpr-conversion should be fixed, soon treated as a hard error

tromey at sourceware dot org sourceware-bugzilla@sourceware.org
Sat Feb 3 21:14:46 GMT 2024


https://sourceware.org/bugzilla/show_bug.cgi?id=31331

--- Comment #2 from Tom Tromey <tromey at sourceware dot org> ---
I changed enum-flags.h to use std::underlying_type, with the idea
that if there were any errors, I'd simply change the base
enum to use an unsigned type.  (I tried auditing the existing
uses by hand but I lost interest partway through.)

Anyway to my surprise, the only compilation issues were in
the enum-flags unit-tests, in a section that's explicitly
commented as being unimportant.

This is in fact the 'CHECK_VALID' call that's pointed out
in the above-linked commit message.  However, that case tests
something that I think is very weird, code of the form:

auto var = cond ? enum_1 : enum_2;

I find it pretty unlikely that this code appears anywhere in
gdb, or that we'd want it to.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Gdb-prs mailing list