]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: Constrain visibility for CNTTPs with internal types [PR118849]
authorNathaniel Shead <nathanieloshead@gmail.com>
Wed, 12 Feb 2025 12:07:43 +0000 (23:07 +1100)
committerNathaniel Shead <nathanieloshead@gmail.com>
Thu, 13 Feb 2025 11:32:15 +0000 (22:32 +1100)
commit0e485b8c85c31856b9f7c91015ac94874b100bd4
tree94c64d0a005a863c91fb77a71cb3a8e737e8f7f5
parenta1855a3e0bcf0f94bc9fa421ccc9ebd0565c62cd
c++: Constrain visibility for CNTTPs with internal types [PR118849]

While looking into PR118846 I noticed that we don't currently constrain
the linkage of functions involving CNTTPs of internal-linkage types.  It
seems to me that this would be sensible to do.

PR c++/118849

gcc/cp/ChangeLog:

* decl2.cc (min_vis_expr_r): Constrain visibility according to
the type of decl_constant_var_p decls.

gcc/testsuite/ChangeLog:

* g++.dg/template/linkage6.C: New test.

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