File tree Expand file tree Collapse file tree 2 files changed +4
-9
lines changed Expand file tree Collapse file tree 2 files changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -2278,9 +2278,6 @@ class Sema final {
2278
2278
2279
2279
bool isAcceptableSlow(const NamedDecl *D, AcceptableKind Kind);
2280
2280
2281
- // Determine whether the module M belongs to the current TU.
2282
- bool isModuleUnitOfCurrentTU(const Module *M) const;
2283
-
2284
2281
public:
2285
2282
/// Get the module unit whose scope we are currently within.
2286
2283
Module *getCurrentModule() const {
@@ -2301,6 +2298,9 @@ class Sema final {
2301
2298
return DirectModuleImports.contains(M);
2302
2299
}
2303
2300
2301
+ // Determine whether the module M belongs to the current TU.
2302
+ bool isModuleUnitOfCurrentTU(const Module *M) const;
2303
+
2304
2304
/// Make a merged definition of an existing hidden definition \p ND
2305
2305
/// visible at the specified location.
2306
2306
void makeMergedDefinitionVisible(NamedDecl *ND);
Original file line number Diff line number Diff line change @@ -1920,12 +1920,7 @@ bool LookupResult::isReachableSlow(Sema &SemaRef, NamedDecl *D) {
1920
1920
// If D comes from a module and SemaRef doesn't own a module, it implies D
1921
1921
// comes from another TU. In case SemaRef owns a module, we could judge if D
1922
1922
// comes from another TU by comparing the module unit.
1923
- //
1924
- // FIXME: It would look better if we have direct method to judge whether D is
1925
- // in another TU.
1926
- if (SemaRef.getCurrentModule () &&
1927
- SemaRef.getCurrentModule ()->getTopLevelModule () ==
1928
- DeclModule->getTopLevelModule ())
1923
+ if (SemaRef.isModuleUnitOfCurrentTU (DeclModule))
1929
1924
return true ;
1930
1925
1931
1926
// [module.reach]/p3:
You can’t perform that action at this time.
0 commit comments