[PATCH] D134898: [Clang] define __cpp_named_character_escapes

Roy Jacobson via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 29 11:26:47 PDT 2022


royjacobson created this revision.
royjacobson added a reviewer: cor3ntin.
Herald added a project: All.
royjacobson requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Define the feature test macro for named character escapes.
I assume this was not done because it was implemented before formally accepted, right? cxx_status says the paper is implemented.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D134898

Files:
  clang/lib/Frontend/InitPreprocessor.cpp
  clang/test/Lexer/cxx-features.cpp


Index: clang/test/Lexer/cxx-features.cpp
===================================================================
--- clang/test/Lexer/cxx-features.cpp
+++ clang/test/Lexer/cxx-features.cpp
@@ -51,7 +51,7 @@
 #error "wrong value for __cpp_static_call_operator"
 #endif
 
-#if check(named_character_escapes, 0, 0, 0, 0, 0, 0)
+#if check(named_character_escapes, 202207L, 202207L, 202207L, 202207L, 202207L, 202207L)
 #error "wrong value for __cpp_named_character_escapes"
 #endif
 
Index: clang/lib/Frontend/InitPreprocessor.cpp
===================================================================
--- clang/lib/Frontend/InitPreprocessor.cpp
+++ clang/lib/Frontend/InitPreprocessor.cpp
@@ -696,6 +696,8 @@
     Builder.defineMacro("__cpp_if_consteval", "202106L");
     Builder.defineMacro("__cpp_multidimensional_subscript", "202110L");
   }
+  Builder.defineMacro("__cpp_named_character_escapes", "202207L");
+
   if (LangOpts.Char8)
     Builder.defineMacro("__cpp_char8_t", "201811L");
   Builder.defineMacro("__cpp_impl_destroying_delete", "201806L");


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D134898.463974.patch
Type: text/x-patch
Size: 1050 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220929/1b318923/attachment.bin>


More information about the cfe-commits mailing list