public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/106656] New: [C++23] P2513 - char8_t Compatibility and Portability Fixes
@ 2022-08-16 17:26 mpolacek at gcc dot gnu.org
2022-08-16 17:26 ` [Bug c++/106656] " mpolacek at gcc dot gnu.org
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2022-08-16 17:26 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106656
Bug ID: 106656
Summary: [C++23] P2513 - char8_t Compatibility and Portability
Fixes
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: mpolacek at gcc dot gnu.org
Target Milestone: ---
See <https://wg21.link/p2513>.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/106656] [C++23] P2513 - char8_t Compatibility and Portability Fixes
2022-08-16 17:26 [Bug c++/106656] New: [C++23] P2513 - char8_t Compatibility and Portability Fixes mpolacek at gcc dot gnu.org
@ 2022-08-16 17:26 ` mpolacek at gcc dot gnu.org
2022-09-26 17:34 ` cvs-commit at gcc dot gnu.org
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2022-08-16 17:26 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106656
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Assignee|unassigned at gcc dot gnu.org |mpolacek at gcc dot gnu.org
Blocks| |98940
Ever confirmed|0 |1
Last reconfirmed| |2022-08-16
Status|UNCONFIRMED |ASSIGNED
Referenced Bugs:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98940
[Bug 98940] Implement C++23 language features
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/106656] [C++23] P2513 - char8_t Compatibility and Portability Fixes
2022-08-16 17:26 [Bug c++/106656] New: [C++23] P2513 - char8_t Compatibility and Portability Fixes mpolacek at gcc dot gnu.org
2022-08-16 17:26 ` [Bug c++/106656] " mpolacek at gcc dot gnu.org
@ 2022-09-26 17:34 ` cvs-commit at gcc dot gnu.org
2022-09-26 17:42 ` mpolacek at gcc dot gnu.org
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-09-26 17:34 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106656
--- Comment #1 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Marek Polacek <mpolacek@gcc.gnu.org>:
https://gcc.gnu.org/g:567329fdd9d65a1e6254206fefff89fa151ba7f3
commit r13-2881-g567329fdd9d65a1e6254206fefff89fa151ba7f3
Author: Marek Polacek <polacek@redhat.com>
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[] = u8"howdy";
because it said "Declarations of arrays of char may currently be
initialized
with UTF-8 string literals. Under this proposal, such initializations would
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 restriction
has been lifted for initialization only, not implicit conversions. Also,
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.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/106656] [C++23] P2513 - char8_t Compatibility and Portability Fixes
2022-08-16 17:26 [Bug c++/106656] New: [C++23] P2513 - char8_t Compatibility and Portability Fixes mpolacek at gcc dot gnu.org
2022-08-16 17:26 ` [Bug c++/106656] " mpolacek at gcc dot gnu.org
2022-09-26 17:34 ` cvs-commit at gcc dot gnu.org
@ 2022-09-26 17:42 ` mpolacek at gcc dot gnu.org
2023-02-07 14:47 ` dmjpp at hotmail dot com
2023-02-07 15:06 ` mpolacek at gcc dot gnu.org
4 siblings, 0 replies; 6+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2022-09-26 17:42 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106656
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|ASSIGNED |RESOLVED
--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Implemented in GCC 13.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/106656] [C++23] P2513 - char8_t Compatibility and Portability Fixes
2022-08-16 17:26 [Bug c++/106656] New: [C++23] P2513 - char8_t Compatibility and Portability Fixes mpolacek at gcc dot gnu.org
` (2 preceding siblings ...)
2022-09-26 17:42 ` mpolacek at gcc dot gnu.org
@ 2023-02-07 14:47 ` dmjpp at hotmail dot com
2023-02-07 15:06 ` mpolacek at gcc dot gnu.org
4 siblings, 0 replies; 6+ messages in thread
From: dmjpp at hotmail dot com @ 2023-02-07 14:47 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106656
Dimitrij Mijoski <dmjpp at hotmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |dmjpp at hotmail dot com
--- Comment #3 from Dimitrij Mijoski <dmjpp at hotmail dot com> ---
The documentation for CLI flag -fchar8_t should be updated
https://gcc.gnu.org/onlinedocs/gcc/C_002b_002b-Dialect-Options.html .
Is there any chance that this fix gets backported because it is treated as
defect report to C++20?
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/106656] [C++23] P2513 - char8_t Compatibility and Portability Fixes
2022-08-16 17:26 [Bug c++/106656] New: [C++23] P2513 - char8_t Compatibility and Portability Fixes mpolacek at gcc dot gnu.org
` (3 preceding siblings ...)
2023-02-07 14:47 ` dmjpp at hotmail dot com
@ 2023-02-07 15:06 ` mpolacek at gcc dot gnu.org
4 siblings, 0 replies; 6+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2023-02-07 15:06 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106656
--- Comment #4 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
(In reply to Dimitrij Mijoski from comment #3)
> The documentation for CLI flag -fchar8_t should be updated
> https://gcc.gnu.org/onlinedocs/gcc/C_002b_002b-Dialect-Options.html .
Oh right, this is not an error anymore:
char ca[] = u8"xx";
I'll fix, thanks.
> Is there any chance that this fix gets backported because it is treated as
> defect report to C++20?
I wasn't really planning to do that.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2023-02-07 15:06 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-16 17:26 [Bug c++/106656] New: [C++23] P2513 - char8_t Compatibility and Portability Fixes mpolacek at gcc dot gnu.org
2022-08-16 17:26 ` [Bug c++/106656] " mpolacek at gcc dot gnu.org
2022-09-26 17:34 ` cvs-commit at gcc dot gnu.org
2022-09-26 17:42 ` mpolacek at gcc dot gnu.org
2023-02-07 14:47 ` dmjpp at hotmail dot com
2023-02-07 15:06 ` mpolacek at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).