gcc/gcc/c-family
Tom Honermann 053876cdbe preprocessor/106426: Treat u8 character literals as unsigned in char8_t modes.
This patch corrects handling of UTF-8 character literals in preprocessing
directives so that they are treated as unsigned types in char8_t enabled
C++ modes (C++17 with -fchar8_t or C++20 without -fno-char8_t). Previously,
UTF-8 character literals were always treated as having the same type as
ordinary character literals (signed or unsigned dependent on target or use
of the -fsigned-char or -funsigned char options).

	PR preprocessor/106426

gcc/c-family/ChangeLog:
	* c-opts.cc (c_common_post_options): Assign cpp_opts->unsigned_utf8char
	subject to -fchar8_t, -fsigned-char, and/or -funsigned-char.

gcc/testsuite/ChangeLog:
	* g++.dg/ext/char8_t-char-literal-1.C: Check signedness of u8 literals.
	* g++.dg/ext/char8_t-char-literal-2.C: Check signedness of u8 literals.

libcpp/ChangeLog:
	* charset.cc (narrow_str_to_charconst): Set signedness of CPP_UTF8CHAR
	literals based on unsigned_utf8char.
	* include/cpplib.h (cpp_options): Add unsigned_utf8char.
	* init.cc (cpp_create_reader): Initialize unsigned_utf8char.
2022-08-08 19:50:40 +00:00
..
ChangeLog Daily bump. 2022-08-01 00:16:31 +00:00
ChangeLog.gimple-classes
c-ada-spec.cc Reduce usage of limited_with clauses with -fdump-ada-spec 2022-05-18 16:30:48 +02:00
c-ada-spec.h Change references of .c files to .cc files 2022-01-17 22:12:07 +01:00
c-attribs.cc Adding three new function attributes for static analysis of file descriptors 2022-07-23 10:46:17 +05:30
c-common.cc c++: Fix location for -Wunused-macros [PR66290] 2022-07-31 07:48:47 -04:00
c-common.def Update copyright years. 2022-01-03 10:42:10 +01:00
c-common.h c++: Fix location for -Wunused-macros [PR66290] 2022-07-31 07:48:47 -04:00
c-cppbuiltin.cc c++: P2493 feature test macro updates 2022-02-09 09:41:01 -05:00
c-dump.cc Rename .c files to .cc files. 2022-01-17 22:12:04 +01:00
c-format.cc libcpp: Improve encapsulation of label_text 2022-07-15 09:40:47 +01:00
c-format.h Update copyright years. 2022-01-03 10:42:10 +01:00
c-gimplify.cc Enable match.pd dumping with -fdump-tree-original 2022-05-09 09:43:08 +01:00
c-indentation.cc Update per-file selftest and finalization hooks for .c to .cc renaming 2022-01-19 11:33:53 -05:00
c-indentation.h Change references of .c files to .cc files 2022-01-17 22:12:07 +01:00
c-lex.cc C: Implement C2X N2653 char8_t and UTF-8 string literal changes 2022-08-08 19:50:38 +00:00
c-objc.h Change references of .c files to .cc files 2022-01-17 22:12:07 +01:00
c-omp.cc openmp: Add support for inoutset depend-kind 2022-05-17 15:40:27 +02:00
c-opts.cc preprocessor/106426: Treat u8 character literals as unsigned in char8_t modes. 2022-08-08 19:50:40 +00:00
c-pch.cc Rename .c files to .cc files. 2022-01-17 22:12:04 +01:00
c-ppoutput.cc preprocessor: Set input_location to the most recently seen token 2022-07-27 18:09:17 -04:00
c-pragma.cc c-family: Fix option check in handle_pragma_diagnostic [PR106252] 2022-07-11 08:42:39 -04:00
c-pragma.h diagnostics: Honor #pragma GCC diagnostic in the preprocessor [PR53431] 2022-07-06 15:00:09 -04:00
c-pretty-print.cc c-family: Fix up ICE during pretty-printing of PMF related expression [PR101515] 2022-03-19 08:40:47 +01:00
c-pretty-print.h Use "final" and "override" directly, rather than via macros 2022-05-20 10:05:54 -04:00
c-semantics.cc Rename .c files to .cc files. 2022-01-17 22:12:04 +01:00
c-spellcheck.cc Update copyright years. 2022-01-03 10:42:10 +01:00
c-spellcheck.h Update copyright years. 2022-01-03 10:42:10 +01:00
c-target-def.h Update copyright years. 2022-01-03 10:42:10 +01:00
c-target.def texi + c-target.def: Fix typos 2022-03-13 10:23:07 +01:00
c-target.h Update copyright years. 2022-01-03 10:42:10 +01:00
c-ubsan.cc ubsan: Add -fsanitize-trap= support 2022-06-18 11:09:48 +02:00
c-ubsan.h Update copyright years. 2022-01-03 10:42:10 +01:00
c-warn.cc c, c++: -Wswitch warning on [[maybe_unused]] enumerator [PR105497] 2022-05-18 10:34:30 -04:00
c.opt c++: Include -Woverloaded-virtual in -Wall [PR87729] 2022-06-24 18:23:48 -04:00
cppspec.cc Rename .c files to .cc files. 2022-01-17 22:12:04 +01:00
known-headers.cc c-family: Add <time.h> names to diagnostics for known headers 2022-06-30 17:46:16 +01:00
known-headers.h Update copyright years. 2022-01-03 10:42:10 +01:00
name-hint.h Update copyright years. 2022-01-03 10:42:10 +01:00
stub-objc.cc Rename .c files to .cc files. 2022-01-17 22:12:04 +01:00