From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5908D3858C50; Thu, 6 Apr 2023 09:15:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5908D3858C50 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1680772545; bh=xPNqtQYeS2au9MXqXxP2TU2/E1ABHsdESe+9BSY0tIU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=HlCJ/m8spOSwKTiSBIZY2IwjWjAwLLUu5OykM5zy/F4jC+0lIDgKT5fA3yv2GLmDe LuLVJYms6krv/vleszaACGJEy6t8PxYeLXl1czcNeyjrLbtmqAgsYP+fETJu6/UjbH LweFDBfxPoSjBI//yGfu6wOOrBFJbtjateh/DMkI= From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/88508] std::bad_cast in std::basic_ostringstream.oss.fill() Date: Thu, 06 Apr 2023 09:15:39 +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: 8.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: DUPLICATE 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=3D88508 --- Comment #3 from Jonathan Wakely --- (In reply to Frank Heckenbach from comment #2) > And all that because the library > doesn't know what the space character is in UTF-8. That's a completely wrong description of the problem. The standard library does not come with support for using char8_t as the character type for streams. That's it. Period. The problem has nothing to do with the setw manipulator or the space charac= ter or even UTF-8, it's that char8_t type is not supported by streams out of the box. You would need to imbue the stream with the relevant facets such as ctype.=