stdlib: Suppress gcc diagnostic that char8_t is a keyword in C++20 in uchar.h.
commit825f84f133bd840347dc49229b6d831f07d04775
authorTom Honermann <tom@honermann.net>
Sun, 24 Jul 2022 05:11:43 +0000 (24 01:11 -0400)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Mon, 1 Aug 2022 12:39:07 +0000 (1 09:39 -0300)
treee4784a7e57e53707a81a6d4f96895da68f13bd73
parent5fded9c44537283593a7f839347f831e15726572
stdlib: Suppress gcc diagnostic that char8_t is a keyword in C++20 in uchar.h.

gcc 13 issues the following diagnostic for the uchar.h header when the
-Wc++20-compat option is enabled in C++ modes that do not enable char8_t
as a builtin type (C++17 and earlier by default; subject to _GNU_SOURCE
and the gcc -f[no-]char8_t option).
  warning: identifier ‘char8_t’ is a keyword in C++20 [-Wc++20-compat]
This change modifies the uchar.h header to suppress the diagnostic through
the use of '#pragma GCC diagnostic' directives for gcc 10 and later (the
-Wc++20-compat option was added in gcc version 10).  Unfortunately, a bug
in gcc currently prevents those directives from having the intended effect
as reported at https://gcc.gnu.org/PR106423.  A patch for that issue has
been submitted and is available in the email thread archive linked below.
  https://gcc.gnu.org/pipermail/gcc-patches/2022-July/598736.html
wcsmbs/uchar.h