PR c++/91370 - Implement P1041R4 and P1139R2 - Stronger Unicode reqs
authorJakub Jelinek <jakub@redhat.com>
Thu, 7 Nov 2019 20:24:38 +0000 (21:24 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Thu, 7 Nov 2019 20:24:38 +0000 (21:24 +0100)
commit2c03d73667df53165834e9bcb5d09243db414ec3
tree2b484f05c4147f1d373d5966366fa8899c4c8a74
parent8b4f2b5e0871d32d0f78ce3f3250af71bfb6f65a
PR c++/91370 - Implement P1041R4 and P1139R2 - Stronger Unicode reqs

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.

From-SVN: r277929
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp1z/utf8-neg.C
gcc/testsuite/g++.dg/cpp2a/ucn2.C [new file with mode: 0644]
gcc/testsuite/g++.dg/ext/utf16-4.C
gcc/testsuite/g++.dg/ext/utf32-4.C
libcpp/ChangeLog
libcpp/charset.c