[clang] [clang] SFINAE context refactor (PR #164703)

Younan Zhang via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 22 19:15:29 PDT 2025


================
@@ -3914,10 +3902,10 @@ static TemplateDeductionResult instantiateExplicitSpecifierDeferred(
 
   Sema::InstantiatingTemplate Inst(
       S, Info.getLocation(), FunctionTemplate, DeducedArgs,
-      Sema::CodeSynthesisContext::DeducedTemplateArgumentSubstitution, Info);
+      Sema::CodeSynthesisContext::DeducedTemplateArgumentSubstitution);
   if (Inst.isInvalid())
     return TemplateDeductionResult::InstantiationDepth;
-  Sema::SFINAETrap Trap(S);
+  Sema::SFINAETrap Trap(S, Info);
----------------
zyn0217 wrote:

I remembered `instantiateExplicitSpecifierDeferred` is called from FinishTemplateArgumentDeduction where we do have a SFINAETrap setup.

Maybe we can get rid of the Trap here and InstantiatingTemplate on line 3903?

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


More information about the cfe-commits mailing list