[clang] [Clang] Support libstdc++ workarounds when using `-E` (PR #210802)

Corentin Jabot via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 24 07:30:13 PDT 2026


================
@@ -1018,9 +1018,16 @@ std::optional<uint64_t> Preprocessor::getStdLibCxxVersion() {
   return std::nullopt;
 }
 
+void Preprocessor::setStdLibCxxVersion(std::uint64_t Version) {
+  CXXStandardLibraryVersion = {
+      CXXStandardLibraryVersionInfo::LibStdCXX,
+      Version,
+  };
+}
+
 bool Preprocessor::NeedsStdLibCxxWorkaroundBefore(uint64_t FixedVersion) {
   assert(FixedVersion >= 2000'00'00 && FixedVersion <= 2100'00'00 &&
-         "invalid value for __GLIBCXX__");
+         "invalid libstdc++ version number");
----------------
cor3ntin wrote:

Given that will only trigger if someone does something deeply weird, I don't think we are doing them a favor by not pointing then to the relevant issue

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


More information about the cfe-commits mailing list