From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 263783858C2D; Mon, 5 Feb 2024 20:09:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 263783858C2D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1707163793; bh=odtkp4IcK5iW6MkvcFLJCK/9HlFttiGEkv97mpVJ1Xw=; h=From:To:Subject:Date:In-Reply-To:References:From; b=idv8Xm9Cne3rkDbteUFnb6J67OQJD7lZbs+n+W+ksBc6W6utEn3GSuCxOH+N2uc0Y u5GtPp4SLgF0z/mpYhdu5UkJcczEneiPNRNL3viUSluKGKXApIvSNUQMpuiVbIZaHK ON7RYhyzF/FEG6+NSDpRQbP8aAyFro73DpwDY/ak= From: "simon.marchi at polymtl dot ca" To: gdb-prs@sourceware.org Subject: [Bug gdb/31331] Wenum-constexpr-conversion should be fixed, soon treated as a hard error Date: Mon, 05 Feb 2024 20:09:52 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: gdb X-Bugzilla-Version: HEAD X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: simon.marchi at polymtl dot ca X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D31331 --- Comment #17 from Simon Marchi --- (In reply to Carlos Galvez from comment #11) > So I applied this change: >=20 > $ git diff gdbsupport/ > diff --git a/gdbsupport/enum-flags.h b/gdbsupport/enum-flags.h > index 50780043477..212a51396e8 100644 > --- a/gdbsupport/enum-flags.h > +++ b/gdbsupport/enum-flags.h > @@ -94,7 +94,7 @@ struct enum_underlying_type > DIAGNOSTIC_PUSH > DIAGNOSTIC_IGNORE_ENUM_CONSTEXPR_CONVERSION > typedef typename > - integer_for_size(T (-1) < T (0))>::type > + integer_for_size std::underlying_type::type>::value>::type > type; > DIAGNOSTIC_POP > }; >=20 >=20 > And leads to the above-attached diff in testsuite/gdb.sum. I'm not sure w= hat > to make of it, but it does seem to reduce the number of unexpected failur= es? >=20 > < # of expected passes 104586 > < # of unexpected failures 685 > --- > > # of expected passes 104601 > > # of unexpected failures 680 > 108988c108993 > < # of known failures 99 > --- > > # of known failures 97 For the record, if we choose to go with underlying_type, I think we can get= rid of this integer_for_size thing altogether and use std::underlying_type to define enum_flags::underlying_type directly. I pinged Pedro Alves, original author of this code, he'll take a look soon. --=20 You are receiving this mail because: You are on the CC list for the bug.=