c++: Seed imported bindings [PR 99039]
authorNathan Sidwell <nathan@acm.org>
Fri, 12 Feb 2021 16:43:09 +0000 (08:43 -0800)
committerNathan Sidwell <nathan@acm.org>
Fri, 12 Feb 2021 21:50:03 +0000 (13:50 -0800)
commit8c4137c7ead515baaf1ac8340edeb3a442388b5b
treed6ccd7dde1ca9927baaefec183c28bd9619e0546
parent0c27fe96f812df76ca07272d3c68765bd1f9dc08
c++: Seed imported bindings [PR 99039]

As mentioned in 99040's fix, we can get inter-module using decls.  If the
using decl is the only reference to an import, we'll have failed to
seed our imports leading to an assertion failure.  The fix is
straight-forwards, check binding contents when seeding imports.

gcc/cp/
* module.cc (module_state::write_cluster): Check bindings for
imported using-decls.
gcc/testsuite/
* g++.dg/modules/pr99039_a.C: New.
* g++.dg/modules/pr99039_b.C: New.
gcc/cp/module.cc
gcc/testsuite/g++.dg/modules/pr99039_a.C [new file with mode: 0644]
gcc/testsuite/g++.dg/modules/pr99039_b.C [new file with mode: 0644]