diff --git a/clang/lib/Frontend/InitPreprocessor.cpp b/clang/lib/Frontend/InitPreprocessor.cpp --- a/clang/lib/Frontend/InitPreprocessor.cpp +++ b/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"); diff --git a/clang/test/Lexer/cxx-features.cpp b/clang/test/Lexer/cxx-features.cpp --- a/clang/test/Lexer/cxx-features.cpp +++ b/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