From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B78473858C78; Mon, 17 Apr 2023 05:24:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B78473858C78 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1681709057; bh=tAM3HtIM5Qn1ApA09BeWH33xqKK4TC/8aU0qpisNPf4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=imBdSMLRhUYXkUIAegfnV5RSHPLObVMwapOCdu4jFgN0NPJjFW13xChqFAeHCgqhZ TrvJf5uskhFaC1fmo8E3BY4rpzVq7W8R5F44IwFgy+cgi+XsvNA28zo28k0H3101MS Wwp/4o0zmyNwoXw3zlw4tV3hjhV3qQBTxvIGqnoc= From: "klaus.doldinger64 at googlemail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/109532] -fshort-enums does not pick smallest underlying type for scoped enum Date: Mon, 17 Apr 2023 05:24:17 +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: klaus.doldinger64 at googlemail dot com 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 #3 from Wilhelm M --- (In reply to Andrew Pinski from comment #2) > (In reply to Andrew Pinski from comment #1) > > That is because a scopped enum has an underlying type of int if not sup= plied. > >=20 > > From [dcl.enum]/5: > > For a scoped enumeration type, the underlying type is int if it is not > > explicitly specified. >=20 > I should say this is from the C++ standard there. > -fshort-enums does not change the language, only ABI. Isn't this a case where the as-if rule kicks in?=