Skip to content

Commit 6d7e156

Browse files
committed
[FOLD] use LookupParsedName for class member access
1 parent 329574e commit 6d7e156

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

clang/lib/Sema/SemaExprMember.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,7 @@ static bool LookupMemberExprInRecord(Sema &SemaRef, LookupResult &R,
675675
CXXScopeSpec &SS, bool HasTemplateArgs,
676676
SourceLocation TemplateKWLoc,
677677
TypoExpr *&TE) {
678-
#if 1
678+
#if 0
679679
DeclContext *DC = SemaRef.computeDeclContext(RTy);
680680
// If the object expression is dependent and isn't the current instantiation,
681681
// lookup will not find anything and we must defer until instantiation.
@@ -704,15 +704,18 @@ static bool LookupMemberExprInRecord(Sema &SemaRef, LookupResult &R,
704704
QualType ObjectType = SS.isSet() ? QualType() : RTy;
705705
if (HasTemplateArgs || TemplateKWLoc.isValid()) {
706706
bool MOUS;
707-
return SemaRef.LookupTemplateName(R,
707+
bool Invalid = 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;
714717
}
715-
#if 0
718+
#if 1
716719
SemaRef.LookupParsedName(R, /*S=*/nullptr, &SS, ObjectType);
717720
#else
718721
if (SS.isSet()) {
@@ -750,7 +753,7 @@ static bool LookupMemberExprInRecord(Sema &SemaRef, LookupResult &R,
750753

751754
DeclarationName Typo = R.getLookupName();
752755
SourceLocation TypoLoc = R.getNameLoc();
753-
#if 0
756+
#if 1
754757
DeclContext *DC = SS.isSet()
755758
? SemaRef.computeDeclContext(SS)
756759
: SemaRef.computeDeclContext(RTy);

0 commit comments

Comments
 (0)