From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id DFB6E3858418; Sun, 4 Feb 2024 19:56:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DFB6E3858418 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1707076562; bh=EjM411ecYs9sIIheHkug4LW/BxBjXXQZrLxFSBvnymU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=wIA4B+z70pbCFqKIaxk+uj77RdnHZgKL1+hRnMHHUJn4GWddDxX3j3va1JAeTRsCv xKO0DPMrI4V8vTJvGpNLQhJmJMZcKRtYIpF5q+T8VY+YsWU+BnTOH9UpTV9/UFF+A3 hqmT31BuDzzHbfKH/7tdedlm4RZoOlyFRgDXp9Ig= From: "tromey at sourceware dot org" To: gdb-prs@sourceware.org Subject: [Bug gdb/31331] Wenum-constexpr-conversion should be fixed, soon treated as a hard error Date: Sun, 04 Feb 2024 19:56:02 +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: tromey at sourceware dot org 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 #5 from Tom Tromey --- (In reply to Simon Marchi from comment #4) > The expression "T (-1) < T (0)" in enum-flags.h is ultimately used to > defined the traits type EnumIsUnsigned and EnumIsSigned. And those are u= sed > to enable or disable the use of operator~ on enum / enum flag types that > behave like signed types. I guess because operator~ is not well-defined = for > them? Yeah, this makes sense to me. But my real proposal is going to be that we simply require an unsigned enum type and add a static assert to this effect. To me this seems fine because, AFAIK, this code is only used for the case where the base enum is a bunch of flags, and never for something weird involving negative values. --=20 You are receiving this mail because: You are on the CC list for the bug.=