From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E795A3858C20; Sun, 24 Dec 2023 15:30:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E795A3858C20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1703431802; bh=vgCIEh9WApTrVC0Rwh6cK2xoZExyrk2jbh28NBjeo5k=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ClsYBYUG3a0J+tARdUv9AizzVFYpFTg/DrcnL8Dni7yn4xX94pxKh8JvOZHFYMY3O FoE1pScOKZ9rkkoRx6Tzhn6Afzueyz6RqTL/ecAxoruh0uGWqzDS2Xnzhady1/7pSO 6Ki6OyCFGuw8Np9BTRXxxHfIACK86kTv5XDC3TWs= From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/113099] locale without RTTI uses dynamic_cast before gcc 13.2 or has ODR violation since gcc 13.2 Date: Sun, 24 Dec 2023 15:30:02 +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.4.0 X-Bugzilla-Keywords: ABI, documentation X-Bugzilla-Severity: normal X-Bugzilla-Who: redi at gcc dot gnu.org 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: 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=3D113099 --- Comment #9 from Jonathan Wakely --- (In reply to Jonathan Wakely from comment #8) > (In reply to Peter Dimov from comment #7) > > You don't necessarily need dynamic_cast because facets are always insta= lled > > and obtained by their exact type, not via a reference to base. >=20 > Is that true? std::use_facet will return a reference to a facet with > X::id but it could actually be something derived from X. e.g. a user can > install their own facet derived from std::ctype, which overrides so= me > members. Code that does std::use_facet>(loc) will get the > user's facet, but via reference to base. And I guess if the user's derived facet uses virtual inheritance from std::locale::facet, then this could break with the static_cast*> in libstdc++ today. Hmm.=