[clang] [Clang] Improve infrastructure for libstdc++ workarounds (PR #141977)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Fri May 30 06:44:03 PDT 2025


================
@@ -979,3 +979,50 @@ Preprocessor::EvaluateDirectiveExpression(IdentifierInfo *&IfNDefMacro,
   return EvaluateDirectiveExpression(IfNDefMacro, Tok, EvaluatedDefined,
                                      CheckForEoD);
 }
+
+static std::optional<CXXStandardLibraryVersionInfo>
+getCXXStandardLibraryVersion(Preprocessor &PP, StringRef MacroName,
+                             CXXStandardLibraryVersionInfo::Library Lib) {
+  MacroInfo *Macro = PP.getMacroInfo(PP.getIdentifierInfo(MacroName));
+
+  if (!Macro || Macro->getNumTokens() != 1)
----------------
erichkeane wrote:

Should we also check `isObjectLike` here too?

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


More information about the cfe-commits mailing list