From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 514DD38515CD; Wed, 18 May 2022 12:42:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 514DD38515CD From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/96710] __int128 vs Date: Wed, 18 May 2022 12:42:27 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: NEW 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: 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: Wed, 18 May 2022 12:42:27 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D96710 --- Comment #2 from Jonathan Wakely --- (In reply to Jonathan Wakely from comment #0) > Our definitions of is_scalar depends on is_arithmetic, so > is_scalar<__int128> is false, and therefore is_object<__int128> is false. > This is clearly nonsense. Hmm, what I wrote is nonsense. Our is_object does not depend on is_scalar: /// is_object template struct is_object : public __not_<__or_, is_reference<_Tp>, is_void<_Tp>>>::type { }; So is_object<__int128> is always true. But is_scalar<__int128> still depends on __STRICT_ANSI__ which seems wrong. It's not a compound type, so it's scalar. Currently we define is_scalar as: template struct is_scalar : public __or_, is_enum<_Tp>, is_pointer<_Tp>, is_member_pointer<_Tp>, is_null_pointer<_Tp>>::type { }; I think a better definition would be: template struct is_scalar : public __and_, __not_>, __not_>, __not_>> { }; Which could be optimized using partial specializations for the array cases: template struct is_scalar : public __and_, __not_>, __not_>> { }; template struct is_scalar<_Tp[]> : public false_type { }; template struct is_scalar<_Tp[_Num]> : public false_type { };=