From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id CD4ED386EC54; Thu, 27 May 2021 22:32:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CD4ED386EC54 From: "harald at gigawatt dot nl" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/100805] __int128 should be disabled for non-extended -std= options Date: Thu, 27 May 2021 22:32:20 +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: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: harald at gigawatt dot nl X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: 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: cc 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 May 2021 22:32:20 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D100805 Harald van Dijk changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |harald at gigawatt dot nl --- Comment #2 from Harald van Dijk --- (In reply to Andreas Schwab from comment #1) > The C++ standard says: [lex.icon] "If an integer literal cannot be > represented by any type in its list and an extended integer type (6.8.1) = can > represent its value, it may have that extended integer type." __int128 behaves mostly like an integer type but is not an "extended integer type" as defined in the standard. Quoting from https://gcc.gnu.org/onlinedocs/gcc/Integers-implementation.html: "GCC does = not support any extended integer types." Extended integer types must meet speci= fic requirements that __int128 does not meet: extended integer types cannot be larger than intmax_t, and __int128 is. Despite __int128 not being an extended integer type, there is nothing wrong with having __int128 enabled in standards-conforming mode. Out-of-range constants must be diagnosed, but they already are, and continuing to accept= the program after that is valid. The warning that is generated for the out-of-range constant is highly misleading though: the warning says "integer constant is so large that it is unsigned". Either the constant should be given an unsigned type, or the war= ning should be updated to reflect the type the constant actually gets.=