c++: Fix indirect partitions [PR 98944]
authorNathan Sidwell <nathan@acm.org>
Tue, 9 Feb 2021 16:11:58 +0000 (08:11 -0800)
committerNathan Sidwell <nathan@acm.org>
Tue, 9 Feb 2021 16:17:12 +0000 (08:17 -0800)
commit92941cea2f05a8cf79fc71aa39fa948dcfb82d7a
tree00a2763e9a640813f764a0d60f83d7761fb53556
parent26a3f288f1895a8c061c0458590542a3d2ee796a
c++: Fix indirect partitions [PR 98944]

The most recent reimplementation of module loading initialization
changed the behaviour of setting an import's location, and broke some
partition handling.

PR c++/98944
gcc/cp/
* module.cc (module_state::is_rooted): Rename to ...
(module_state::has_location): ... here.  Adjust callers.
(module_state::read_partitions): Adjust validity check.
Don't overwrite a known location.
gcc/testsuite/
* g++.dg/modules/pr98944_a.C: New.
* g++.dg/modules/pr98944_b.C: New.
* g++.dg/modules/pr98944_c.C: New.
* g++.dg/modules/pr98944_d.C: New.
gcc/cp/module.cc
gcc/testsuite/g++.dg/modules/pr98944_a.C [new file with mode: 0644]
gcc/testsuite/g++.dg/modules/pr98944_b.C [new file with mode: 0644]
gcc/testsuite/g++.dg/modules/pr98944_c.C [new file with mode: 0644]
gcc/testsuite/g++.dg/modules/pr98944_d.C [new file with mode: 0644]