preprocessor: Disable trigraphs for C2x
authorJoseph Myers <joseph@codesourcery.com>
Mon, 5 Sep 2022 22:05:06 +0000 (22:05 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Mon, 5 Sep 2022 22:05:06 +0000 (22:05 +0000)
commit5f38bf14bcb3ffe9fcd482b87cbf381df24a31df
tree931967ebf968b3fb3fd6cbe927500a878bc88144
parent5f895f22173d78c1995a001d721d2ae1d075797b
preprocessor: Disable trigraphs for C2x

ISO C2x removes trigraphs, so disable them accordingly for -std=c2x
(they can still be enabled using -trigraphs).

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

libcpp/
* init.cc (lang_defaults): Disable trigraphs for C2x.

gcc/testsuite/
* gcc.dg/cpp/c11-trigraphs-1.c, gcc.dg/cpp/c2x-trigraphs-1.c,
gcc.dg/cpp/c2x-trigraphs-2.c: New tests.
gcc/testsuite/gcc.dg/cpp/c11-trigraphs-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/cpp/c2x-trigraphs-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/cpp/c2x-trigraphs-2.c [new file with mode: 0644]
libcpp/init.cc