[PATCH] D151741: [Lex] Only warn on defining or undefining language-defined builtins

Nick Desaulniers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 30 12:13:11 PDT 2023


nickdesaulniers added inline comments.


================
Comment at: clang/lib/Lex/PPDirectives.cpp:163-172
+  // C defines macros starting with __STDC, and C++ defines macros starting with
+  // __STDCPP
+  if (MacroName.startswith("__STDC"))
+    return true;
+  // C++ defines the __cplusplus macro
+  if (MacroName == "__cplusplus")
+    return true;
----------------
Should these depend on LangOpt?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D151741/new/

https://reviews.llvm.org/D151741



More information about the cfe-commits mailing list