Bug 106647 - [C++23] P2362 - Remove non-encodable wide character literals and multicharacter wide character literals
Summary: [C++23] P2362 - Remove non-encodable wide character literals and multicharact...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: unknown
: P3 normal
Target Milestone: ---
Assignee: Jakub Jelinek
URL:
Keywords:
Depends on:
Blocks: c++23-core
  Show dependency treegraph
 
Reported: 2022-08-16 16:50 UTC by Marek Polacek
Modified: 2022-08-26 14:08 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2022-08-25 00:00:00


Attachments
gcc13-pr106647.patch (1.13 KB, patch)
2022-08-25 16:59 UTC, Jakub Jelinek
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Marek Polacek 2022-08-16 16:50:50 UTC
See <https://wg21.link/p2362>.
Comment 1 Jakub Jelinek 2022-08-25 16:59:05 UTC
Created attachment 53509 [details]
gcc13-pr106647.patch

Untested implementation.
Comment 2 GCC Commits 2022-08-26 14:07:03 UTC
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:dad2d3e003f1a9885cb1fa0f67baf50f62d57b06

commit r13-2221-gdad2d3e003f1a9885cb1fa0f67baf50f62d57b06
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Fri Aug 26 16:06:20 2022 +0200

    libcpp: Implement P2362R3 - Remove non-encodable wide character literals and multicharacter [PR106647]
    
    My understanding of the paper is that we just want to promote the CPP_WCHAR
    "character constant too long for its type" warning to error as it is already
    error for u8, u and U literals.
    
    2022-08-26  Jakub Jelinek  <jakub@redhat.com>
    
            PR c++/106647
            * charset.cc (wide_str_to_charconst): Implement P2362R3 - Remove
            non-encodable wide character literals and multicharacter.  For
            C++23 use CPP_DL_ERROR instead of CPP_DL_WARNING for
            "character constant too long for its type" diagnostics on CPP_WCHAR
            literals.
    
            * g++.dg/cpp23/wchar-multi1.C: New test.
            * g++.dg/cpp23/wchar-multi2.C: New test.
Comment 3 Jakub Jelinek 2022-08-26 14:08:01 UTC
Now implemented for GCC 13.