Skip to content

Commit 4c51d82

Browse files
committed
[C++20] [Modules] Add Decl::isFromGlobalModule
1 parent 1c499a7 commit 4c51d82

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

clang/include/clang/AST/DeclBase.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -680,6 +680,9 @@ class alignas(8) Decl {
680680
/// Whether this declaration comes from explicit global module.
681681
bool isFromExplicitGlobalModule() const;
682682

683+
/// Whether this declaration comes from global module.
684+
bool isFromGlobalModule() const;
685+
683686
/// Whether this declaration comes from a named module.
684687
bool isInNamedModule() const;
685688

clang/lib/AST/DeclBase.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1161,6 +1161,10 @@ bool Decl::isFromExplicitGlobalModule() const {
11611161
return getOwningModule() && getOwningModule()->isExplicitGlobalModule();
11621162
}
11631163

1164+
bool Decl::isFromGlobalModule() const {
1165+
return getOwningModule() && getOwningModule()->isGlobalModule();
1166+
}
1167+
11641168
bool Decl::isInNamedModule() const {
11651169
return getOwningModule() && getOwningModule()->isNamedModule();
11661170
}

0 commit comments

Comments
 (0)