================
@@ -1342,7 +1342,10 @@ QualType 
Sema::CheckNonTypeTemplateParameterType(TypeSourceInfo *&TSI,
     //    - an identifier associated by name lookup with a non-type
     //      template-parameter declared with a type that contains a
     //      placeholder type (7.1.7.4),
-    TSI = SubstAutoTypeSourceInfoDependent(TSI);
+    TypeSourceInfo *NewTSI = SubstAutoTypeSourceInfoDependent(TSI);
+    if (!NewTSI)
+      return QualType();
+    TSI = NewTSI;
----------------
sdkrystian wrote:

We only want to update `TSI` if `SubstAutoTypeSourceInfoDependent` succeeds, so 
a new variable is necessary to preserve the old value in case of failure (the 
parameter is a reference).

https://github.com/llvm/llvm-project/pull/186200
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to