[clang] [Clang] Defer the instantiation of explicit-specifier until constraint checking completes (PR #70548)

via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 31 10:02:26 PDT 2023


================
@@ -3580,16 +3580,12 @@ static Sema::TemplateDeductionResult instantiateExplicitSpecifierDeferred(
   if (!Expr->isValueDependent()) {
     return Sema::TDK_Success;
   }
-  // The `InstantiatingTemplate` here is used to restore `ActiveInstType` to
-  // `DeducedTemplateArgumentSubstitution` because ActiveInstType was set to
-  // `TemplateInstantiation` in
-  // `TemplateDeclInstantiator::InitFunctionInstantiation`. The real depth of
-  // instantiation should be the same as the depth in
-  // `FinishTemplateArgumentDeduction`.
-  // So we don't check `InstantiatingTemplate::IsValid` here.
   Sema::InstantiatingTemplate Inst(
       S, Info.getLocation(), FunctionTemplate, DeducedArgs,
       Sema::CodeSynthesisContext::DeducedTemplateArgumentSubstitution, Info);
+  if (Inst.isInvalid()) {
----------------
LYP951018 wrote:

Thanks for catching this! I’m still adapting to the LLVM coding style :(
I've fixed all similar cases.

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


More information about the cfe-commits mailing list