Skip to content

Commit 2b67b4b

Browse files
committed
[FOLD] build DependentMemberExpr for LookupResult::FoundUnresolved
1 parent 4f149a1 commit 2b67b4b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

clang/lib/Sema/SemaExprMember.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,6 @@ static bool LookupMemberExprInRecord(Sema &SemaRef, LookupResult &R,
676676
CXXScopeSpec &SS, bool HasTemplateArgs,
677677
SourceLocation TemplateKWLoc,
678678
TypoExpr *&TE) {
679-
RecordDecl *RDecl = RTy->getAsRecordDecl();
680679
DeclContext *DC = SemaRef.computeDeclContext(RTy);
681680
// If the object expression is dependent and isn't the current instantiation,
682681
// lookup will not find anything and we must defer until instantiation.
@@ -1015,7 +1014,9 @@ Sema::BuildMemberReferenceExpr(Expr *BaseExpr, QualType BaseExprType,
10151014
bool SuppressQualifierCheck,
10161015
ActOnMemberAccessExtraArgs *ExtraArgs) {
10171016

1018-
if (R.wasNotFoundInCurrentInstantiation() || (SS.isValid() && !computeDeclContext(SS, false))) {
1017+
if (R.wasNotFoundInCurrentInstantiation() ||
1018+
(SS.isValid() && !computeDeclContext(SS, false)) ||
1019+
(R.isUnresolvableResult() && R.isClassLookup() && R.getNamingClass()->isDependentContext())) {
10191020
return ActOnDependentMemberExpr(BaseExpr, BaseExprType,
10201021
IsArrow, OpLoc,
10211022
SS, TemplateKWLoc, FirstQualifierInScope,

0 commit comments

Comments
 (0)