Skip to content

Commit 7f19dbe

Browse files
committed
[FOLD]
1 parent 3c9d3ea commit 7f19dbe

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

clang/lib/Sema/SemaExpr.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2757,8 +2757,7 @@ Sema::ActOnIdExpression(Scope *S, CXXScopeSpec &SS,
27572757
&AssumedTemplate))
27582758
return ExprError();
27592759

2760-
if (MemberOfUnknownSpecialization ||
2761-
(R.getResultKind() == LookupResult::NotFoundInCurrentInstantiation))
2760+
if (R.wasNotFoundInCurrentInstantiation())
27622761
return ActOnDependentIdExpression(SS, TemplateKWLoc, NameInfo,
27632762
IsAddressOfOperand, TemplateArgs);
27642763
} else {

clang/lib/Sema/SemaExprMember.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -704,16 +704,13 @@ static bool LookupMemberExprInRecord(Sema &SemaRef, LookupResult &R,
704704
QualType ObjectType = SS.isSet() ? QualType() : RTy;
705705
if (HasTemplateArgs || TemplateKWLoc.isValid()) {
706706
bool MOUS;
707-
bool Invalid = SemaRef.LookupTemplateName(R,
707+
return SemaRef.LookupTemplateName(R,
708708
/*S=*/nullptr,
709709
SS,
710710
ObjectType,
711711
/*EnteringContext=*/false,
712712
MOUS,
713713
TemplateKWLoc);
714-
if (MOUS)
715-
R.setNotFoundInCurrentInstantiation();
716-
return Invalid;
717714
}
718715
#if 1
719716
SemaRef.LookupParsedName(R, /*S=*/nullptr, &SS, ObjectType);

clang/lib/Sema/SemaTemplate.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ TemplateNameKind Sema::isTemplateName(Scope *S,
213213
&AssumedTemplate,
214214
/*AllowTypoCorrection=*/!Disambiguation))
215215
return TNK_Non_template;
216+
MemberOfUnknownSpecialization = R.wasNotFoundInCurrentInstantiation();
216217

217218
if (AssumedTemplate != AssumedTemplateKind::None) {
218219
TemplateResult = TemplateTy::make(Context.getAssumedTemplateName(TName));
@@ -558,6 +559,7 @@ bool Sema::LookupTemplateName(LookupResult &Found,
558559
if (Found.empty()) {
559560
if (IsDependent) {
560561
MemberOfUnknownSpecialization = true;
562+
Found.setNotFoundInCurrentInstantiation();
561563
return false;
562564
}
563565

0 commit comments

Comments
 (0)