Skip to content

Commit e623bf5

Browse files
committed
Use MLTAL.replaceInnermostTemplateArguments to avoid the special-casing
1 parent 9f935ab commit e623bf5

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

clang/lib/Sema/SemaConcept.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1132,14 +1132,12 @@ static bool CheckFunctionConstraintsWithoutInstantiation(
11321132
// FIXME: Add TemplateArgs through the 'Innermost' parameter once
11331133
// the refactoring of getTemplateInstantiationArgs() relands.
11341134
MultiLevelTemplateArgumentList MLTAL;
1135-
MLTAL.addOuterTemplateArguments(Template, /*Args=*/TemplateArgs,
1136-
/*Final=*/false);
1135+
MLTAL.addOuterTemplateArguments(Template, std::nullopt, /*Final=*/false);
11371136
SemaRef.getTemplateInstantiationArgs(
1138-
MLTAL, /*D=*/nullptr,
1139-
FD->getFriendObjectKind() ? FD->getLexicalDeclContext()
1140-
: FD->getDeclContext(),
1137+
MLTAL, /*D=*/FD, FD,
11411138
/*Final=*/false, /*Innermost=*/std::nullopt, /*RelativeToPrimary=*/true,
11421139
/*Pattern=*/nullptr, /*ForConstraintInstantiation=*/true);
1140+
MLTAL.replaceInnermostTemplateArguments(Template, TemplateArgs);
11431141

11441142
Sema::ContextRAII SavedContext(SemaRef, FD);
11451143
std::optional<Sema::CXXThisScopeRAII> ThisScope;

clang/lib/Sema/SemaTemplateInstantiate.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1388,7 +1388,7 @@ namespace {
13881388
void setEvaluateConstraints(bool B) {
13891389
EvaluateConstraints = B;
13901390
}
1391-
bool getEvaluateConstraints() const {
1391+
bool getEvaluateConstraints() {
13921392
return EvaluateConstraints;
13931393
}
13941394

0 commit comments

Comments
 (0)