From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 92DC53858C62; Mon, 26 Sep 2022 17:34:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 92DC53858C62 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1664213664; bh=ZEQlejjqq2046Zd+W1WFIIBMxTQefHCjFpweGq+zuj0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=FQplK7mUk90RwIEvAMuUQcsem1OEnviiwzC0s2x//LRikvZPfmt6+DB7ayaiABQnE mV3lNKXggSqcWru2M3EcMDh2eKH84dx3HTD2ZYrZNKS0OqtcqcTlyRUbZfZRs6hyom d2rpbVNJbmXV2SQOSgdA5hKEAiTgANF72FdNwDiY= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/106656] [C++23] P2513 - char8_t Compatibility and Portability Fixes Date: Mon, 26 Sep 2022 17:34:24 +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: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: mpolacek 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=3D106656 --- Comment #1 from CVS Commits --- The trunk branch has been updated by Marek Polacek : https://gcc.gnu.org/g:567329fdd9d65a1e6254206fefff89fa151ba7f3 commit r13-2881-g567329fdd9d65a1e6254206fefff89fa151ba7f3 Author: Marek Polacek Date: Fri Sep 23 18:06:34 2022 -0400 c++: P2513R4, char8_t Compatibility and Portability Fix [PR106656] P0482R6, which added char8_t, didn't allow const char arr[] =3D u8"howdy"; because it said "Declarations of arrays of char may currently be initialized with UTF-8 string literals. Under this proposal, such initializations w= ould become ill-formed." This caused too many issues, so P2513R4 alleviates some of those compatibility problems. In particular, "Arrays of char or unsigned char may now be initialized with a UTF-8 string literal." This restric= tion has been lifted for initialization only, not implicit conversions. Als= o, my reading is that 'signed char' was excluded from the allowable conversions. This is supposed to be treated as a DR in C++20. PR c++/106656 gcc/c-family/ChangeLog: * c-cppbuiltin.cc (c_cpp_builtins): Update value of __cpp_char8= _t for C++20. gcc/cp/ChangeLog: * typeck2.cc (array_string_literal_compatible_p): Allow initializing arrays of char or unsigned char by a UTF-8 string literal. gcc/testsuite/ChangeLog: * g++.dg/cpp23/feat-cxx2b.C: Adjust. * g++.dg/cpp2a/feat-cxx2a.C: Likewise. * g++.dg/ext/char8_t-feature-test-macro-2.C: Likewise. * g++.dg/ext/char8_t-init-2.C: Likewise. * g++.dg/cpp2a/char8_t3.C: New test. * g++.dg/cpp2a/char8_t4.C: New test.=