Skip to content

Commit c7aacce

Browse files
committed
Use DeclContext::getNonTransparentContext(); NFC
1 parent 5b6c9a5 commit c7aacce

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

clang/lib/Sema/SemaDeclCXX.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16836,10 +16836,7 @@ NamedDecl *Sema::ActOnFriendFunctionDecl(Scope *S, Declarator &D,
1683616836
while (DC->isRecord())
1683716837
DC = DC->getParent();
1683816838

16839-
DeclContext *LookupDC = DC;
16840-
while (LookupDC->isTransparentContext())
16841-
LookupDC = LookupDC->getParent();
16842-
16839+
DeclContext *LookupDC = DC->getNonTransparentContext();
1684316840
while (true) {
1684416841
LookupQualifiedName(Previous, LookupDC);
1684516842

clang/lib/Sema/SemaExprMember.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -564,10 +564,7 @@ bool Sema::CheckQualifiedMemberReference(Expr *BaseExpr,
564564
return false;
565565

566566
// Note that we use the DC of the decl, not the underlying decl.
567-
DeclContext *DC = (*I)->getDeclContext();
568-
while (DC->isTransparentContext())
569-
DC = DC->getParent();
570-
567+
DeclContext *DC = (*I)->getDeclContext()->getNonTransparentContext();
571568
if (!DC->isRecord())
572569
continue;
573570

0 commit comments

Comments
 (0)