[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.
This commit is contained in:
parent
3090efc6b6
commit
aac4d03423
@ -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;
|
||||
}
|
||||
|
||||
|
||||
6
clang/test/Modules/pr85122.cppm
Normal file
6
clang/test/Modules/pr85122.cppm
Normal file
@ -0,0 +1,6 @@
|
||||
// RUN: %clang_cc1 -std=c++20 %s -Wall -fsyntax-only -verify
|
||||
|
||||
// expected-no-diagnostics
|
||||
export module a;
|
||||
|
||||
export constexpr auto a = []{};
|
||||
Loading…
x
Reference in New Issue
Block a user