[clang] [Clang][Sema] Disable checking invalid template id in initializer of primary variable template `std::format_kind` with libstdc++ (PR #139560)

via cfe-commits cfe-commits at lists.llvm.org
Mon May 12 12:15:15 PDT 2025


================
@@ -4383,6 +4383,11 @@ Sema::CheckVarTemplateId(VarTemplateDecl *Template, SourceLocation TemplateLoc,
     };
 
     if (VarDecl *Var = Template->getTemplatedDecl();
+        // Skipping std::format_kind in libstdc++ is a hack for
+        // GH139067 / https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120190
+        !(Var->getName() == "format_kind" &&
+          Var->getDeclContext()->isStdNamespace() &&
+          PP.isMacroDefined("__GLIBCXX__")) &&
----------------
cor3ntin wrote:

Clang you add something like `// HACK workaround libstdc++ 14.x (2025-02)` so it's easier to find?

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


More information about the cfe-commits mailing list