Skip to content

Commit f428012

Browse files
committed
[FOLD]
1 parent fdc7dee commit f428012

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
@@ -2776,8 +2776,7 @@ Sema::ActOnIdExpression(Scope *S, CXXScopeSpec &SS,
27762776
&AssumedTemplate))
27772777
return ExprError();
27782778

2779-
if (MemberOfUnknownSpecialization ||
2780-
(R.getResultKind() == LookupResult::NotFoundInCurrentInstantiation))
2779+
if (R.wasNotFoundInCurrentInstantiation())
27812780
return ActOnDependentIdExpression(SS, TemplateKWLoc, NameInfo,
27822781
IsAddressOfOperand, TemplateArgs);
27832782
} 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)