File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -794,6 +794,15 @@ SubstituteConstraintExpression(Sema &S,
794794 if (Inst.isInvalid ())
795795 return nullptr ;
796796
797+ // Set up a dummy 'instantiation' scope in the case of reference to function
798+ // parameters that the surrounding function hasn't been instantiated yet. Note
799+ // this may happen while we're comparing two templates' constraint
800+ // equivalence.
801+ LocalInstantiationScope ScopeForParameters (S);
802+ if (auto *FD = llvm::dyn_cast<FunctionDecl>(DeclInfo.getDecl ()))
803+ for (auto *PVD : FD->parameters ())
804+ ScopeForParameters.InstantiatedLocal (PVD, PVD);
805+
797806 std::optional<Sema::CXXThisScopeRAII> ThisScope;
798807 if (auto *RD = dyn_cast<CXXRecordDecl>(DeclInfo.getDeclContext ()))
799808 ThisScope.emplace (S, const_cast <CXXRecordDecl *>(RD), Qualifiers ());
You can’t perform that action at this time.
0 commit comments