[C++20] [Modules] Treat module linkage as formal linkage only
authorChuanqi Xu <yedeng.yd@linux.alibaba.com>
Mon, 13 Mar 2023 07:43:08 +0000 (15:43 +0800)
committerChuanqi Xu <yedeng.yd@linux.alibaba.com>
Mon, 13 Mar 2023 07:54:40 +0000 (15:54 +0800)
commit2e9977c2815653c141c6c060c4e0ab6c0db27911
tree389b35dbf6dbfa3fe1bd8a1293b0f0611637682a
parent2869d31a7ac1e4748d171711614e9a89dfc0f75a
[C++20] [Modules] Treat module linkage as formal linkage only

Close https://github.com/llvm/llvm-project/issues/61321

There are two linkage modes in clang now: one for internal linkage and
one for formal linkage. The internal linkage is for the implementation
details and the formal linkage is for the consistency with the C++
standard.

Since we previously implemented the strong ownership for modules, the
module linkage is not meaningful for linkers any more. So the module
linkage should only be used for formal linkage.
clang/include/clang/AST/Decl.h
clang/lib/AST/Decl.cpp
clang/test/Modules/inconsistent-export.cppm [new file with mode: 0644]
clang/unittests/AST/DeclTest.cpp