Bug 91370 - Implement P1041R4 and P1139R2: Stronger Unicode requirements
Summary: Implement P1041R4 and P1139R2: Stronger Unicode requirements
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 10.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks: c++20-core
  Show dependency treegraph
 
Reported: 2019-08-05 16:48 UTC by Marek Polacek
Modified: 2023-05-22 20:24 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2019-08-05 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marek Polacek 2019-08-05 16:48:33 UTC
As per <http://wg21.link/p1041r4> and <http://wg21.link/p1139r2>.
Comment 1 Jakub Jelinek 2019-11-07 20:25:16 UTC
Author: jakub
Date: Thu Nov  7 20:24:38 2019
New Revision: 277929

URL: https://gcc.gnu.org/viewcvs?rev=277929&root=gcc&view=rev
Log:
	PR c++/91370 - Implement P1041R4 and P1139R2 - Stronger Unicode reqs
	* charset.c (narrow_str_to_charconst): Add TYPE argument.  For
	CPP_UTF8CHAR diagnose whenever number of chars is > 1, using
	CPP_DL_ERROR instead of CPP_DL_WARNING.
	(wide_str_to_charconst): For CPP_CHAR16 or CPP_CHAR32, use
	CPP_DL_ERROR instead of CPP_DL_WARNING when multiple char16_t
	or char32_t chars are needed.
	(cpp_interpret_charconst): Adjust narrow_str_to_charconst caller.

	* g++.dg/cpp1z/utf8-neg.C: Expect errors rather than -Wmultichar
	warnings.
	* g++.dg/ext/utf16-4.C: Expect errors rather than warnings.
	* g++.dg/ext/utf32-4.C: Likewise.
	* g++.dg/cpp2a/ucn2.C: New test.

Added:
    trunk/gcc/testsuite/g++.dg/cpp2a/ucn2.C
Modified:
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/g++.dg/cpp1z/utf8-neg.C
    trunk/gcc/testsuite/g++.dg/ext/utf16-4.C
    trunk/gcc/testsuite/g++.dg/ext/utf32-4.C
    trunk/libcpp/ChangeLog
    trunk/libcpp/charset.c
Comment 2 Jakub Jelinek 2020-11-13 18:45:55 UTC
Fixed for 10.1+.