diff options
author | Nathaniel Shead <nathanieloshead@gmail.com> | 2024-08-15 21:46:09 +1000 |
---|---|---|
committer | Nathaniel Shead <nathanieloshead@gmail.com> | 2024-08-20 17:13:53 +1000 |
commit | c310d29cac1c3a770f48ab8bb2d295ef9cc08c53 (patch) | |
tree | b8520ac5d2b4ed5a77f13ad554714904ffe0f598 /gcc/fortran/iresolve.cc | |
parent | 80fda0ad3142c60dac0d5ef41c3e2141c9e8a521 (diff) | |
download | gcc-c310d29cac1c3a770f48ab8bb2d295ef9cc08c53.zip gcc-c310d29cac1c3a770f48ab8bb2d295ef9cc08c53.tar.gz gcc-c310d29cac1c3a770f48ab8bb2d295ef9cc08c53.tar.bz2 |
c++/modules: Fix type lookup in DECL_TEMPLATE_INSTANTIATIONS [PR116364]
We need to use the DECL_TEMPLATE_INSTANTIATIONS property to find
reachable specialisations from a template to ensure that any GM
specialisations are properly marked as reachable.
Currently the modules code uses the decl when rebuilding this property,
but this is not always correct; it appears that for type specialisations
we need to use the TREE_TYPE of the decl instead so that the
specialisation is correctly found. This patch makes the required
adjustments.
PR c++/116364
gcc/cp/ChangeLog:
* cp-tree.h (get_mergeable_specialization_flags): Adjust
signature.
* module.cc (trees_out::decl_value): Indicate whether this is a
type or decl specialisation.
* pt.cc (get_mergeable_specialization_flags): Match against the
type of a non-decl specialisation.
(add_mergeable_specialization): Use the already calculated spec
instead of always adding decl to DECL_TEMPLATE_INSTANTIATIONS.
gcc/testsuite/ChangeLog:
* g++.dg/modules/tpl-spec-9_a.C: New test.
* g++.dg/modules/tpl-spec-9_b.C: New test.
* g++.dg/modules/tpl-spec-9_c.C: New test.
Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
Reviewed-by: Jason Merrill <jason@redhat.com>
Diffstat (limited to 'gcc/fortran/iresolve.cc')
0 files changed, 0 insertions, 0 deletions