Skip to content

Commit

Permalink
Use DeclContext::getNonTransparentContext(); NFC
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronBallman committed Aug 20, 2021
1 parent 5b6c9a5 commit c7aacce
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
5 changes: 1 addition & 4 deletions clang/lib/Sema/SemaDeclCXX.cpp
Expand Up @@ -16836,10 +16836,7 @@ NamedDecl *Sema::ActOnFriendFunctionDecl(Scope *S, Declarator &D,
while (DC->isRecord())
DC = DC->getParent();

DeclContext *LookupDC = DC;
while (LookupDC->isTransparentContext())
LookupDC = LookupDC->getParent();

DeclContext *LookupDC = DC->getNonTransparentContext();
while (true) {
LookupQualifiedName(Previous, LookupDC);

Expand Down
5 changes: 1 addition & 4 deletions clang/lib/Sema/SemaExprMember.cpp
Expand Up @@ -564,10 +564,7 @@ bool Sema::CheckQualifiedMemberReference(Expr *BaseExpr,
return false;

// Note that we use the DC of the decl, not the underlying decl.
DeclContext *DC = (*I)->getDeclContext();
while (DC->isTransparentContext())
DC = DC->getParent();

DeclContext *DC = (*I)->getDeclContext()->getNonTransparentContext();
if (!DC->isRecord())
continue;

Expand Down

0 comments on commit c7aacce

Please sign in to comment.