Support _Decimal* keywords for C2x.
ISO C2x adds decimal floating point as an optional standard feature.
This patch accordingly makes GCC accept the _Decimal* keywords in
strict C2x mode, using pedwarn_c11 to get a warning for
-Wc11-c2x-compat. (Constants, where the pedwarn is in libcpp, will be
dealt with separately.)
The _Decimal* keywords are marked with D_EXT, meaning they are not
considered keywords at all in strict conformance modes. This is
contrary to the normal practice for most implementation-namespace
keywords, which are accepted in all standards modes but with
appropriate pedwarns for older standards. This patch removes D_EXT
from those keywords so they are accepted as keywords for all
standards, consequently removing the gcc.dg/dfp/keywords-ignored-c99.c
test that is no longer valid.
(A new D_C2X for keywords will still be needed if any new keywords get
added that aren't in the implementation namespace for older standards;
there are proposals for such keywords, albeit as predefined macros
that might not actually need new keywords in the compiler in all
cases. If the DFP keywords end up as decimal32 etc., of course
appropriate compiler and testcase changes will be needed, and a
version of keywords-ignored-c99.c would make sense again with such
spellings.)
Bootstrapped with no regressions on x86_64-pc-linux-gnu.
gcc/c:
* c-decl.c (declspecs_add_type): Use pedwarn_c11 for DFP types.
gcc/c-family:
* c-common.c (c_common_reswords): Do not use D_EXT for _Decimal32,
_Decimal64 and _Decimal128.
gcc/testsuite:
* gcc.dg/dfp/c11-keywords-1.c, gcc.dg/dfp/c11-keywords-2.c,
gcc.dg/dfp/c2x-keywords-1.c, gcc.dg/dfp/c2x-keywords-2.c: New
tests.
* gcc.dg/dfp/keywords-ignored-c99.c: Remove test.
* gcc.dg/dfp/constants-c99.c, gcc.dg/dfp/keywords-c89.c,
gcc.dg/dfp/keywords-c99.c: Use -pedantic-errors.
From-SVN: r276896
13 files changed: