aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Sema/SemaModule.cpp
diff options
context:
space:
mode:
authorChuanqi Xu <yedeng.yd@linux.alibaba.com>2024-04-19 09:46:16 +0800
committerChuanqi Xu <yedeng.yd@linux.alibaba.com>2024-04-19 09:46:18 +0800
commitaac4d03423dd6b7bdef0f2eb03c570f3e2ca6630 (patch)
tree8eb16a90ccfcb8c33ff9a2b3349f0ca0b6b1cbfc /clang/lib/Sema/SemaModule.cpp
parent3090efc6b65be0aa26b2ed0b734eef6efdd50322 (diff)
downloadllvm-aac4d03423dd6b7bdef0f2eb03c570f3e2ca6630.zip
llvm-aac4d03423dd6b7bdef0f2eb03c570f3e2ca6630.tar.gz
llvm-aac4d03423dd6b7bdef0f2eb03c570f3e2ca6630.tar.bz2
[C++20] [Modules] Mark exported all declarations as used
Close https://github.com/llvm/llvm-project/issues/85122 As the title suggested, it looks pretty sensible.
Diffstat (limited to 'clang/lib/Sema/SemaModule.cpp')
-rw-r--r--clang/lib/Sema/SemaModule.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaModule.cpp b/clang/lib/Sema/SemaModule.cpp
index 67658c9..ad118ac 100644
--- a/clang/lib/Sema/SemaModule.cpp
+++ b/clang/lib/Sema/SemaModule.cpp
@@ -1003,6 +1003,10 @@ Decl *Sema::ActOnFinishExportDecl(Scope *S, Decl *D, SourceLocation RBraceLoc) {
}
}
+ // Anything exported from a module should never be considered unused.
+ for (auto *Exported : ED->decls())
+ Exported->markUsed(getASTContext());
+
return D;
}