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

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 31 09:55:16 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()) {
----------------
erichkeane wrote:

This is a single-line block, so per style guide, don't use curley braces.

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


More information about the cfe-commits mailing list