diff options
author | Nathaniel Shead <nathanieloshead@gmail.com> | 2025-02-12 19:15:22 +1100 |
---|---|---|
committer | Nathaniel Shead <nathanieloshead@gmail.com> | 2025-02-15 23:30:09 +1100 |
commit | 9f1f4efc06f43b1ba8c1cf5a31d5b73d6a2bb12d (patch) | |
tree | 970245a15f6640dbee6efd2797caf21067409bb8 /gcc/fortran/trans-expr.cc | |
parent | 741073460b9a850ca85b01509e08bf72900b6c8a (diff) | |
download | gcc-9f1f4efc06f43b1ba8c1cf5a31d5b73d6a2bb12d.zip gcc-9f1f4efc06f43b1ba8c1cf5a31d5b73d6a2bb12d.tar.gz gcc-9f1f4efc06f43b1ba8c1cf5a31d5b73d6a2bb12d.tar.bz2 |
c++/modules: Don't treat template parameters as TU-local [PR118846]
There are two separate issues making various template parameters behave
as if they were TU-local.
Firstly, the TU-local detection code uses WILDCARD_TYPE_P to check for
types that are not yet concrete; for some reason UNBOUND_CLASS_TEMPLATE
is not on that list. I don't see any particular reason why it shouldn't
be, so this patch adds it; this may solve other latent issues as well.
Secondly, the TEMPLATE_DECL for a type with expressions involving
TEMPLATE_TEMPLATE_PARM_Ps is currently always constrained to internal
linkage, because the result does not have TREE_PUBLIC set. Rather than
messing with TREE_PUBLIC here, I think rather we just should ensure that
we only attempt to constrain visiblity of templates of type, variable,
or function decls.
PR c++/118846
gcc/cp/ChangeLog:
* cp-tree.h (WILDCARD_TYPE_P): Include UNBOUND_CLASS_TEMPLATE.
* decl2.cc (min_vis_expr_r): Don't assume a TEMPLATE_DECL will
be a function or variable.
gcc/testsuite/ChangeLog:
* g++.dg/modules/pr118846_a.C: New test.
* g++.dg/modules/pr118846_b.C: New test.
Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
Reviewed-by: Jason Merrill <jason@redhat.com>
Diffstat (limited to 'gcc/fortran/trans-expr.cc')
0 files changed, 0 insertions, 0 deletions