From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2181) id 0C8B23858002; Tue, 6 Jun 2023 11:44:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0C8B23858002 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1686051844; bh=ql+Bl2ipwv5qwwFqeV2qDPUb7lDZxg/El7bMIevopHs=; h=From:To:Subject:Date:From; b=Fg4UcyjxpAmolaZLHUQzhgKu7sCPeIbdsVGu0K27VQHOIAIVb6k7mdJbNkzDStyUi 0mUzREFoDp6wcT7y9cfB8y8Zq/GNPFD4ksdFW3xFJZabgLbjp++w+Hc+q84MN2C7Tf CDiNQPOQO+xwVzCjlaqg+Kj8tFtLYGRBJA4Itv1w= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jonathan Wakely To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r14-1572] libstdc++: Do not assume existence of char8_t codecvt facet X-Act-Checkin: gcc X-Git-Author: Joseph Faulls X-Git-Refname: refs/heads/master X-Git-Oldrev: 7e8e071c4b64f1b6ea5ddf528724fc793a0f0e36 X-Git-Newrev: 3d9b3ddb5fc9087c17645d53e6bcb1881e1955a4 Message-Id: <20230606114404.0C8B23858002@sourceware.org> Date: Tue, 6 Jun 2023 11:44:04 +0000 (GMT) List-Id: https://gcc.gnu.org/g:3d9b3ddb5fc9087c17645d53e6bcb1881e1955a4 commit r14-1572-g3d9b3ddb5fc9087c17645d53e6bcb1881e1955a4 Author: Joseph Faulls Date: Fri Jun 2 15:44:48 2023 +0000 libstdc++: Do not assume existence of char8_t codecvt facet It is not required that codecvt facet be supported by the locale, nor is it added as part of the default locale. This can lead to dangerous behaviour when static_cast. libstdc++-v3/ChangeLog: * include/bits/locale_classes.tcc: Remove check for codecvt facet. Diff: --- libstdc++-v3/include/bits/locale_classes.tcc | 3 --- 1 file changed, 3 deletions(-) diff --git a/libstdc++-v3/include/bits/locale_classes.tcc b/libstdc++-v3/include/bits/locale_classes.tcc index 94838cd7796..2351dd5bcfb 100644 --- a/libstdc++-v3/include/bits/locale_classes.tcc +++ b/libstdc++-v3/include/bits/locale_classes.tcc @@ -129,9 +129,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION _GLIBCXX_STD_FACET(time_put); _GLIBCXX_STD_FACET(messages); #endif -#ifdef _GLIBCXX_USE_CHAR8_T - _GLIBCXX_STD_FACET(codecvt); -#endif #if __cplusplus >= 201103L _GLIBCXX_STD_FACET(codecvt); _GLIBCXX_STD_FACET(codecvt);