@@ -675,7 +675,7 @@ static bool LookupMemberExprInRecord(Sema &SemaRef, LookupResult &R,
675
675
CXXScopeSpec &SS, bool HasTemplateArgs,
676
676
SourceLocation TemplateKWLoc,
677
677
TypoExpr *&TE) {
678
- #if 1
678
+ #if 0
679
679
DeclContext *DC = SemaRef.computeDeclContext(RTy);
680
680
// If the object expression is dependent and isn't the current instantiation,
681
681
// lookup will not find anything and we must defer until instantiation.
@@ -704,15 +704,18 @@ static bool LookupMemberExprInRecord(Sema &SemaRef, LookupResult &R,
704
704
QualType ObjectType = SS.isSet () ? QualType () : RTy;
705
705
if (HasTemplateArgs || TemplateKWLoc.isValid ()) {
706
706
bool MOUS;
707
- return SemaRef.LookupTemplateName (R,
707
+ bool Invalid = SemaRef.LookupTemplateName (R,
708
708
/* S=*/ nullptr ,
709
709
SS,
710
710
ObjectType,
711
711
/* EnteringContext=*/ false ,
712
712
MOUS,
713
713
TemplateKWLoc);
714
+ if (MOUS)
715
+ R.setNotFoundInCurrentInstantiation ();
716
+ return Invalid;
714
717
}
715
- #if 0
718
+ #if 1
716
719
SemaRef.LookupParsedName (R, /* S=*/ nullptr , &SS, ObjectType);
717
720
#else
718
721
if (SS.isSet()) {
@@ -750,7 +753,7 @@ static bool LookupMemberExprInRecord(Sema &SemaRef, LookupResult &R,
750
753
751
754
DeclarationName Typo = R.getLookupName ();
752
755
SourceLocation TypoLoc = R.getNameLoc ();
753
- #if 0
756
+ #if 1
754
757
DeclContext *DC = SS.isSet ()
755
758
? SemaRef.computeDeclContext (SS)
756
759
: SemaRef.computeDeclContext (RTy);
0 commit comments