Skip to content

Commit 321f9aa

Browse files
authored
Merge pull request #77454 from xymus/public-imports-of-private-as-error
Sema: Report public imports of private modules as errors by default
2 parents 555c00a + d90664c commit 321f9aa

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

lib/Sema/TypeCheckDeclPrimary.cpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2411,16 +2411,9 @@ class DeclChecker : public DeclVisitor<DeclChecker> {
24112411
} else
24122412
inFlight.fixItInsert(ID->getStartLoc(), "internal ");
24132413

2414-
#ifndef NDEBUG
2415-
static bool enableTreatAsError = true;
2416-
#else
2417-
static bool enableTreatAsError = getenv("ENABLE_PUBLIC_IMPORT_OF_PRIVATE_AS_ERROR");
2418-
#endif
2419-
24202414
bool isImportOfUnderlying = importer->getName() == target->getName();
24212415
auto *SF = ID->getDeclContext()->getParentSourceFile();
2422-
bool treatAsError = enableTreatAsError &&
2423-
!isImportOfUnderlying &&
2416+
bool treatAsError = !isImportOfUnderlying &&
24242417
SF->Kind != SourceFileKind::Interface;
24252418
if (!treatAsError)
24262419
inFlight.limitBehavior(DiagnosticBehavior::Warning);

0 commit comments

Comments
 (0)