gcc/libcpp
Joseph Myers 0a91bdaf17 c: New C2x keywords
C2x follows C++ in making alignas, alignof, bool, false,
static_assert, thread_local and true keywords; implement this
accordingly.  This implementation makes them normal keywords in C2x
mode just like any other keyword (C2x leaves open the possibility of
implementation using predefined macros instead - thus, there aren't
any testcases asserting that they aren't macros).  As in C++ and
previous versions of C, true and false are handled like signed 1 and 0
in #if (there was an intermediate state in some C2x drafts where they
had different macro expansions that were unsigned in #if).

Bootstrapped with no regressions for x86_64-pc-linux-gnu.

As with the removal of unprototyped functions, this change has a high
risk of breaking some old code and people doing GNU/Linux distribution
builds may wish to see how much is broken in a build with a -std=gnu2x
default.

gcc/
	* ginclude/stdalign.h [defined __STDC_VERSION__ &&
	__STDC_VERSION__ > 201710L]: Disable all content.
	* ginclude/stdbool.h [defined __STDC_VERSION__ && __STDC_VERSION__
	> 201710L] (bool, true, false): Do not define.

gcc/c-family/
	* c-common.cc (c_common_reswords): Use D_C2X instead of D_CXXONLY
	for alignas, alignof, bool, false, static_assert, thread_local and
	true.

gcc/c/
	* c-parser.cc (c_parser_static_assert_declaration_no_semi)
	(c_parser_alignas_specifier, c_parser_alignof_expression): Allow
	for C2x spellings of keywords.
	(c_parser_postfix_expression): Handle RID_TRUE and RID_FALSE.

gcc/testsuite/
	* gcc.dg/c11-keywords-1.c, gcc.dg/c2x-align-1.c,
	gcc.dg/c2x-align-6.c, gcc.dg/c2x-bool-2.c,
	gcc.dg/c2x-static-assert-3.c, gcc.dg/c2x-static-assert-4.c,
	gcc.dg/c2x-thread-local-1.c: New tests.
	* gcc.dg/c2x-bool-1.c: Update expectations.

libcpp/
	* include/cpplib.h (struct cpp_options): Add true_false.
	* expr.cc (eval_token): Check true_false not cplusplus to
	determine whether to handle true and false keywords.
	* init.cc (struct lang_flags): Add true_false.
	(lang_defaults): Update.
	(cpp_set_lang): Set true_false.
2022-09-07 13:56:46 +00:00
..
include c: New C2x keywords 2022-09-07 13:56:46 +00:00
po Daily bump. 2022-05-05 00:16:29 +00:00
aclocal.m4
ChangeLog Daily bump. 2022-09-06 00:17:07 +00:00
ChangeLog.jit
charset.cc libcpp: Named universal character escapes and delimited escape sequence tweaks 2022-09-07 08:44:38 +02:00
config.in aix: handle 64bit inodes for include directories 2022-01-12 16:59:47 +01:00
configure aix: handle 64bit inodes for include directories 2022-01-12 16:59:47 +01:00
configure.ac aix: handle 64bit inodes for include directories 2022-01-12 16:59:47 +01:00
directives.cc preprocessor: Implement C++23 P2437R1 - Support for #warning [PR106646] 2022-08-24 09:55:57 +02:00
errors.cc Rename .c files to .cc files. 2022-01-17 22:12:04 +01:00
expr.cc c: New C2x keywords 2022-09-07 13:56:46 +00:00
files.cc Rename .c files to .cc files. 2022-01-17 22:12:04 +01:00
generated_cpp_wcwidth.h libcpp: Update cpp_wcwidth() to Unicode 14.0.0 2022-06-26 14:13:26 -04:00
identifiers.cc Rename .c files to .cc files. 2022-01-17 22:12:04 +01:00
init.cc c: New C2x keywords 2022-09-07 13:56:46 +00:00
internal.h preprocessor: -Wbidi-chars and UCNs [PR104030] 2022-01-24 17:48:23 -05:00
lex.cc libcpp: Add -Winvalid-utf8 warning [PR106655] 2022-09-01 09:56:44 +02:00
line-map.cc pack fields in line-map data structures 2022-01-18 14:33:01 +01:00
location-example.txt
macro.cc libcpp: Fix up padding handling in funlike_invocation_p [PR104147] 2022-02-01 20:48:03 +01:00
Makefile.in preprocessor: Extract messages from cpp_*_at calls for translation 2022-02-11 23:22:07 +00:00
makeucnid.cc Rename .c files to .cc files. 2022-01-17 22:12:04 +01:00
makeuname2c.cc libcpp: Make static checkers happy about makeuname2c [PR106778] 2022-08-31 10:22:36 +02:00
mkdeps.cc Rename .c files to .cc files. 2022-01-17 22:12:04 +01:00
pch.cc Rename .c files to .cc files. 2022-01-17 22:12:04 +01:00
symtab.cc Rename .c files to .cc files. 2022-01-17 22:12:04 +01:00
system.h Update copyright years. 2022-01-03 10:42:10 +01:00
traditional.cc Change references of .c files to .cc files 2022-01-17 22:12:07 +01:00
ucnid.h libcpp: Update ucnid.h to Unicode 14 2022-06-28 17:33:37 -04:00
ucnid.tab Update copyright years. 2022-01-03 10:42:10 +01:00
uname2c.h c++: Implement C++23 P2071R2 - Named universal character escapes [PR106648] 2022-08-26 09:27:39 +02:00