Skip to content

Commit 7abbe70

Browse files
authored
Merge pull request #30522 from CodaFi/skeleton-key
[NFC] Don't Mutate Flags; Just Read ASTContext::isAccessControlDisabled
2 parents 4876996 + 31cfab8 commit 7abbe70

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

lib/AST/NameLookup.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1371,13 +1371,9 @@ void ClassDecl::recordObjCMethod(AbstractFunctionDecl *method,
13711371
///
13721372
/// This utility is used by qualified name lookup.
13731373
static void configureLookup(const DeclContext *dc,
1374-
NLOptions &options,
1374+
NLOptions options,
13751375
ReferencedNameTracker *&tracker,
13761376
bool &isLookupCascading) {
1377-
auto &ctx = dc->getASTContext();
1378-
if (ctx.isAccessControlDisabled())
1379-
options |= NL_IgnoreAccessControl;
1380-
13811377
// Find the dependency tracker we'll need for this lookup.
13821378
tracker = nullptr;
13831379
if (auto containingSourceFile =
@@ -1439,7 +1435,8 @@ static bool isAcceptableLookupResult(const DeclContext *dc,
14391435
}
14401436

14411437
// Check access.
1442-
if (!(options & NL_IgnoreAccessControl)) {
1438+
if (!(options & NL_IgnoreAccessControl) &&
1439+
!dc->getASTContext().isAccessControlDisabled()) {
14431440
return decl->isAccessibleFrom(dc);
14441441
}
14451442

0 commit comments

Comments
 (0)