gcc/libcpp
Lewis Hyatt 7d112d6670 Support extended characters in C/C++ identifiers (PR c/67224)
libcpp/ChangeLog
2019-09-19  Lewis Hyatt  <lhyatt@gmail.com>

	PR c/67224
	* charset.c (_cpp_valid_utf8): New function to help lex UTF-8 tokens.
	* internal.h (_cpp_valid_utf8): Declare.
	* lex.c (forms_identifier_p): Use it to recognize UTF-8 identifiers.
	(_cpp_lex_direct): Handle UTF-8 in identifiers and CPP_OTHER tokens.
	Do all work in "default" case to avoid slowing down typical code paths.
	Also handle $ and UCN in the default case for consistency.

gcc/Changelog
2019-09-19  Lewis Hyatt  <lhyatt@gmail.com>

	PR c/67224
	* doc/cpp.texi: Document support for extended characters in
	identifiers.
	* doc/cppopts.texi: Likewise.

gcc/testsuite/ChangeLog
2019-09-19  Lewis Hyatt  <lhyatt@gmail.com>

	PR c/67224
	* c-c++-common/cpp/ucnid-2011-1-utf8.c: New test.
	* g++.dg/cpp/ucnid-1-utf8.C: New test.
	* g++.dg/cpp/ucnid-2-utf8.C: New test.
	* g++.dg/cpp/ucnid-3-utf8.C: New test.
	* g++.dg/cpp/ucnid-4-utf8.C: New test.
	* g++.dg/other/ucnid-1-utf8.C: New test.
	* gcc.dg/cpp/ucnid-1-utf8.c: New test.
	* gcc.dg/cpp/ucnid-10-utf8.c: New test.
	* gcc.dg/cpp/ucnid-11-utf8.c: New test.
	* gcc.dg/cpp/ucnid-12-utf8.c: New test.
	* gcc.dg/cpp/ucnid-13-utf8.c: New test.
	* gcc.dg/cpp/ucnid-14-utf8.c: New test.
	* gcc.dg/cpp/ucnid-15-utf8.c: New test.
	* gcc.dg/cpp/ucnid-2-utf8.c: New test.
	* gcc.dg/cpp/ucnid-3-utf8.c: New test.
	* gcc.dg/cpp/ucnid-4-utf8.c: New test.
	* gcc.dg/cpp/ucnid-6-utf8.c: New test.
	* gcc.dg/cpp/ucnid-7-utf8.c: New test.
	* gcc.dg/cpp/ucnid-9-utf8.c: New test.
	* gcc.dg/ucnid-1-utf8.c: New test.
	* gcc.dg/ucnid-10-utf8.c: New test.
	* gcc.dg/ucnid-11-utf8.c: New test.
	* gcc.dg/ucnid-12-utf8.c: New test.
	* gcc.dg/ucnid-13-utf8.c: New test.
	* gcc.dg/ucnid-14-utf8.c: New test.
	* gcc.dg/ucnid-15-utf8.c: New test.
	* gcc.dg/ucnid-16-utf8.c: New test.
	* gcc.dg/ucnid-2-utf8.c: New test.
	* gcc.dg/ucnid-3-utf8.c: New test.
	* gcc.dg/ucnid-4-utf8.c: New test.
	* gcc.dg/ucnid-5-utf8.c: New test.
	* gcc.dg/ucnid-6-utf8.c: New test.
	* gcc.dg/ucnid-7-utf8.c: New test.
	* gcc.dg/ucnid-8-utf8.c: New test.
	* gcc.dg/ucnid-9-utf8.c: New test.

From-SVN: r275979
2019-09-19 20:56:11 +01:00
..
include PR c++/61339 - add mismatch between struct and class [-Wmismatched-tags] to non-bugs 2019-07-09 12:32:49 -06:00
po * zh_TW.po: Update. 2019-08-09 23:02:08 +01:00
ChangeLog Support extended characters in C/C++ identifiers (PR c/67224) 2019-09-19 20:56:11 +01:00
ChangeLog.jit Merger of dmalcolm/jit branch from git 2014-11-11 21:55:52 +00:00
Makefile.in Update copyright years. 2019-01-01 13:31:55 +01:00
aclocal.m4 Update GCC to autoconf 2.69, automake 1.15.1 (PR bootstrap/82856). 2018-10-31 17:03:16 +00:00
charset.c Support extended characters in C/C++ identifiers (PR c/67224) 2019-09-19 20:56:11 +01:00
config.in Update GCC to autoconf 2.69, automake 1.15.1 (PR bootstrap/82856). 2018-10-31 17:03:16 +00:00
configure iconv.m4 (AM_ICONV_LINK): Don't overwrite CPPFLAGS. 2018-11-07 15:41:21 -07:00
configure.ac Update GCC to autoconf 2.69, automake 1.15.1 (PR bootstrap/82856). 2018-10-31 17:03:16 +00:00
directives-only.c [Preprocessor] small cleanups 2019-08-28 18:43:37 +00:00
directives.c [preprocessor] Popping "" file names 2019-09-06 12:54:19 +00:00
errors.c Update copyright years. 2019-01-01 13:31:55 +01:00
expr.c Remove Cell Broadband Engine SPU targets 2019-09-03 15:08:28 +00:00
files.c [preprocessor/91639] #includes at EOF 2019-09-05 11:23:48 +00:00
identifiers.c Update copyright years. 2019-01-01 13:31:55 +01:00
init.c [preprocessor] Include stacking 2019-08-29 14:06:32 +00:00
internal.h Support extended characters in C/C++ identifiers (PR c/67224) 2019-09-19 20:56:11 +01:00
lex.c Support extended characters in C/C++ identifiers (PR c/67224) 2019-09-19 20:56:11 +01:00
line-map.c [preprocessor/91639] #includes at EOF 2019-09-05 11:23:48 +00:00
location-example.txt PR preprocessor/83173: Enhance -fdump-internal-locations output 2018-11-27 16:04:31 +00:00
macro.c Update copyright years. 2019-01-01 13:31:55 +01:00
makeucnid.c Update copyright years. 2019-01-01 13:31:55 +01:00
mkdeps.c PR c++/61339 - add mismatch between struct and class [-Wmismatched-tags] to non-bugs 2019-07-09 12:32:49 -06:00
pch.c Update copyright years. 2019-01-01 13:31:55 +01:00
symtab.c Improve memory statistics report readability. 2019-02-26 17:27:52 +00:00
system.h Update copyright years. 2019-01-01 13:31:55 +01:00
traditional.c Update copyright years. 2019-01-01 13:31:55 +01:00
ucnid.h Update copyright years. 2019-01-01 13:31:55 +01:00
ucnid.tab Update copyright years. 2019-01-01 13:31:55 +01:00