gcc/libcpp/include
Joseph Myers d7c3000147 preprocessor: Support #warning for standard C2x
ISO C2x standardizes the existing #warning extension.  Arrange
accordingly for it not to be diagnosed with -std=c2x -pedantic, but to
be diagnosed with -Wc11-c2x-compat.

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

gcc/testsuite/
	* gcc.dg/cpp/c11-warning-1.c, gcc.dg/cpp/c11-warning-2.c,
	gcc.dg/cpp/c11-warning-3.c, gcc.dg/cpp/c11-warning-4.c,
	gcc.dg/cpp/c2x-warning-1.c, gcc.dg/cpp/c2x-warning-2.c,
	gcc.dg/cpp/gnu11-warning-1.c, gcc.dg/cpp/gnu11-warning-2.c,
	gcc.dg/cpp/gnu11-warning-3.c, gcc.dg/cpp/gnu11-warning-4.c,
	gcc.dg/cpp/gnu2x-warning-1.c, gcc.dg/cpp/gnu2x-warning-2.c: New
	tests.

libcpp/
	* include/cpplib.h (struct cpp_options): Add warning_directive.
	* init.cc (struct lang_flags, lang_defaults): Add
	warning_directive.
	* directives.cc (DIRECTIVE_TABLE): Mark #warning as STDC2X not
	EXTENSION.
	(directive_diagnostics): Diagnose #warning with -Wc11-c2x-compat,
	or with -pedantic for a standard not supporting #warning.
2022-08-18 23:01:01 +00:00
..
cpplib.h preprocessor: Support #warning for standard C2x 2022-08-18 23:01:01 +00:00
line-map.h libcpp: Improve encapsulation of label_text 2022-07-15 09:40:47 +01:00
mkdeps.h Change references of .c files to .cc files 2022-01-17 22:12:07 +01:00
symtab.h Update copyright years. 2022-01-03 10:42:10 +01:00