Skip to content

Commit 0ebe9a1

Browse files
authored
Merge pull request #28218 from CodaFi/curb-cuts
[NFC] Swap the order of checks in redeclaration checking
2 parents 3975e72 + 701392f commit 0ebe9a1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/Sema/TypeCheckDecl.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -710,10 +710,6 @@ static void checkRedeclaration(ASTContext &ctx, ValueDecl *current) {
710710
if (!conflicting(currentSig, otherSig))
711711
continue;
712712

713-
// Skip invalid declarations.
714-
if (other->isInvalid())
715-
continue;
716-
717713
// Skip declarations in other files.
718714
// In practice, this means we will warn on a private declaration that
719715
// shadows a non-private one, but only in the file where the shadowing
@@ -722,6 +718,10 @@ static void checkRedeclaration(ASTContext &ctx, ValueDecl *current) {
722718
if (!other->isAccessibleFrom(currentDC))
723719
continue;
724720

721+
// Skip invalid declarations.
722+
if (other->isInvalid())
723+
continue;
724+
725725
// Thwart attempts to override the same declaration more than once.
726726
const auto *currentOverride = current->getOverriddenDecl();
727727
const auto *otherOverride = other->getOverriddenDecl();

0 commit comments

Comments
 (0)