[clang] [clang-tools-extra] [libcxx] [Clang] Keep the deduced TSI in sync with its DeducedTemplateSpecializationType (PR #181105)

Corentin Jabot via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 12 02:44:24 PST 2026


================
@@ -2208,8 +2209,9 @@ ExprResult Sema::BuildCXXNew(SourceRange Range, bool UseGlobal,
 
     InitializedEntity Entity
       = InitializedEntity::InitializeNew(StartLoc, AllocType);
-    AllocType = DeduceTemplateSpecializationFromInitializer(
+    TypeSourceInfo *TSI = DeduceTemplateSpecializationFromInitializer(
         AllocTypeInfo, Entity, Kind, Exprs);
+    AllocType = TSI ? TSI->getType() : QualType();
----------------
cor3ntin wrote:

Maybe we want a DeduceTemplateSpecializationQualTypeFromInitializer that does that dense, given that there is only one place where you actually use the TypeSourceInfo.

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


More information about the cfe-commits mailing list