From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 55F2A385840D; Tue, 18 Apr 2023 08:15:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 55F2A385840D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1681805716; bh=H/uKz/6b6LHelxu125AOR7Gg+DTCPOsmGfVl8AOooNc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=mz9GC9TFSHnhEJBUJVEUgXFh8/PHpl32yxHkOvJsXgJriDqcV2kql1ADpXaj/9ui7 21w+YIoa+G7ZVarpgrQPs5Kub7wemuBa638q7Xwb+HGJo5NG9zhmMD97Q1DeIiQcye W4wYgQUP+tG2qyPS7j0ZllwdORoLRBHFF5iKnyGY= From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/109532] -fshort-enums does not pick smallest underlying type for scoped enum Date: Tue, 18 Apr 2023 08:15:15 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: INVALID X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.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://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D109532 --- Comment #6 from Jonathan Wakely --- (In reply to Wilhelm M from comment #5) > So in general a scoped-enum inside a class (nested type) maybe always a b= ad > idea, because it prevents optimization. I don't know how you have drawn that conclusion or how it's related to this= bug report. > And when specifying the underlying > type, the -fstrict-enums can't be applied because all values of the > underlying type are possible. Correct, with a fixed underlying type -fstrict-enums and -fshort-enums have= no effect.=