]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: Allow exporting const-qualified namespace-scope variables [PR99232]
authorNathaniel Shead <nathanieloshead@gmail.com>
Wed, 15 Nov 2023 09:50:53 +0000 (20:50 +1100)
committerNathaniel Shead <nathanieloshead@gmail.com>
Fri, 24 Nov 2023 13:55:15 +0000 (00:55 +1100)
commit726723c476800285cfbdfce612cedde4a9a7ad58
tree10918be4ef394341f17fa2c39573dbaae01e1a42
parentaea337cf740ec33022f3cabfa7dd4333d5ba78ee
c++: Allow exporting const-qualified namespace-scope variables [PR99232]

By [basic.link] p3.2.1, a non-template non-volatile const-qualified
variable is not necessarily internal linkage in a module declaration,
and rather may have module linkage (or external linkage if it is
exported, see p4.8).

PR c++/99232

gcc/cp/ChangeLog:

* decl.cc (grokvardecl): Don't mark variables attached to
modules as internal.

gcc/testsuite/ChangeLog:

* g++.dg/modules/pr99232_a.C: New test.
* g++.dg/modules/pr99232_b.C: New test.

Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
gcc/cp/decl.cc
gcc/testsuite/g++.dg/modules/pr99232_a.C [new file with mode: 0644]
gcc/testsuite/g++.dg/modules/pr99232_b.C [new file with mode: 0644]