[clang] [Clang] Use Compat diagnostics for most extension/compatibility warnings (PR #216693)

Nikolas Klauser via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 2 07:58:07 PDT 2026


================
@@ -11,6 +11,17 @@
 //===----------------------------------------------------------------------===//
 
 let Component = "Lex", CategoryName = "Lexical or Preprocessor Issue" in {
+// C23 compatibility with C17 and earlier.
+defm c23_pp_directive : C23Compat<
+  "use of a '#%select{<BUG IF SEEN>|elifdef|elifndef}0' directive is", /*ext_warn*/true>;
+
+// C++23 compatibility with C++20 and earlier.
+defm cxx23_pp_directive : CXX23Compat<
+  "use of a '#%select{<BUG IF SEEN>|elifdef|elifndef}0' directive is">;
+
+// C++26 compatibility with C++23 and earlier.
+defm raw_string_literal_character_set : CXX26Compat<
+  " '%0' in a raw string literal delimiter is", /*ext_warn*/false>;
----------------
philnik777 wrote:

Yeah, I wasn't sure whether this should be changed, so I just left it as-is. Happy to remove the leading space though.

https://github.com/llvm/llvm-project/pull/216693


More information about the cfe-commits mailing list