c++: Predefine __cpp_named_character_escapes=202207L for C++23 [PR106648]
Commit Message
On Sun, Aug 21, 2022 at 08:18:02PM +0200, Jakub Jelinek via Gcc-patches wrote:
> Resending with the generated uname2c.h part of patch split into
> compressed attachment, as it was too large for gcc-patches.
Unfortunately seems I forgot about the feature test macro for this, here
is an incremental patch for it.
Tested on x86_64-linux and i686-linux, ok for trunk together with the
rest of the implementation?
2022-08-22 Jakub Jelinek <jakub@redhat.com>
PR c++/106648
* c-cppbuiltin.cc (c_cpp_builtins): Predefine
__cpp_named_character_escapes to 202207L.
* g++.dg/cpp23/feat-cxx2b.C: Test __cpp_named_character_escapes.
Jakub
@@ -1080,6 +1080,7 @@ c_cpp_builtins (cpp_reader *pfile)
cpp_define (pfile, "__cpp_if_consteval=202106L");
cpp_define (pfile, "__cpp_constexpr=202110L");
cpp_define (pfile, "__cpp_multidimensional_subscript=202110L");
+ cpp_define (pfile, "__cpp_named_character_escapes=202207L");
}
if (flag_concepts)
{
@@ -557,3 +557,9 @@
#elif __cpp_multidimensional_subscript != 202110
# error "__cpp_multidimensional_subscript != 202110"
#endif
+
+#ifndef __cpp_named_character_escapes
+# error "__cpp_named_character_escapes"
+#elif __cpp_named_character_escapes != 202207
+# error "__cpp_named_character_escapes != 202207"
+#endif