[clang] Fix missing initializer for inline static template member with auto caused by delayed template instantiation. (PR #138122)

via cfe-commits cfe-commits at lists.llvm.org
Thu May 1 06:39:03 PDT 2025


================
@@ -6027,8 +6027,15 @@ void Sema::BuildVariableInstantiation(
   Context.setManglingNumber(NewVar, Context.getManglingNumber(OldVar));
   Context.setStaticLocalNumber(NewVar, Context.getStaticLocalNumber(OldVar));
 
+  bool VarTemplateWithAutoType = false;
+  QualType VarSourceType = OldVar->getTypeSourceInfo()->getType();
+  if (VarSourceType->getAs<AutoType>()) {
+    VarTemplateWithAutoType = true;
+  }
+
----------------
dty2 wrote:

Your suggestion is correct, I will adopt it.

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


More information about the cfe-commits mailing list