c++: Seed namespaces for bindings [PR106363]
commitcb76f46c97e9f4e4869acceb77a000b6cc2cda0e
authorNathaniel Shead <nathanieloshead@gmail.com>
Sun, 12 Nov 2023 00:54:43 +0000 (12 11:54 +1100)
committerNathaniel Shead <nathanieloshead@gmail.com>
Sat, 16 Dec 2023 23:38:35 +0000 (17 10:38 +1100)
treea244dbfdbd022db5aa207436e43460519ff3f395
parent7abc7aae564e63173fbaa14805e3dddea7f6a160
c++: Seed namespaces for bindings [PR106363]

Currently the first depset for an EK_BINDING is not seeded. This breaks
the attached testcase as then the namespace is not considered referenced
yet during streaming, but we've already finished importing.

There doesn't seem to be any particular reason I could find for skipping
the first depset for bindings, and removing the condition doesn't appear
to cause any test failures, so this patch removes that check.

PR c++/106363

gcc/cp/ChangeLog:

* module.cc (module_state::write_cluster): Don't skip first
depset for bindings.

gcc/testsuite/ChangeLog:

* g++.dg/modules/pr106363_a.C: New test.
* g++.dg/modules/pr106363_b.C: New test.

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