[C++2x][Modules] Amend module purview constant linkage [P2788R0].
authorIain Sandoe <iain@sandoe.co.uk>
Sun, 12 Mar 2023 20:45:26 +0000 (20:45 +0000)
committerIain Sandoe <iain@sandoe.co.uk>
Sun, 19 Mar 2023 16:25:56 +0000 (16:25 +0000)
commit62a16d5e2069542351c164aa0e3b216dc8e153c4
tree95d5ae8b0eaaf5b264a599925b524c00c8267244
parentd233c7b814071e8b9345b1c25411272ec7446c8d
[C++2x][Modules] Amend module purview constant linkage [P2788R0].

This paper has been applied to the working draft and is believed to be
a DR against C++20, so that the patch here makes the change unconditionally.

for:
```
export module A;

const int mod_cst = 10;
```
Before the change, mod_cst would have internal linkage; after the change it
has module linkage.

Differential Revision: https://reviews.llvm.org/D145886
clang/lib/AST/Decl.cpp
clang/test/CXX/module/basic/basic.def.odr/p4.cppm
clang/test/CXX/module/basic/basic.link/p3.cppm