summaryrefslogtreecommitdiff
path: root/gcc/testsuite/go.test/go-test.exp
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@acm.org>2021-01-29 08:30:40 -0800
committerNathan Sidwell <nathan@acm.org>2021-01-29 09:11:46 -0800
commit83bdc9f70347e6438822e719c30c3793c81df18e (patch)
tree7896170a775ad200579e23fa8ce711c9190a3788 /gcc/testsuite/go.test/go-test.exp
parent2dd1f944547eb6560c3e15a4b705ae1ac236df75 (diff)
downloadgcc-83bdc9f70347e6438822e719c30c3793c81df18e.tar.gz
c++: Fix unordered entity array [PR 98843]
A couple of module invariants are that the modules are always allocated in ascending order and appended to the module array. The entity array is likewise ordered, with each module having spans in that array in ascending order. Prior to header-units, this was provided by the way import declarations were encountered. With header-units we need to load the preprocessor state of header units before we parse the C++, and this can lead to incorrect ordering of the entity array. I had made the initialization of a module's language state a little too lazy. This moves the allocation of entity array spans into the initial read of a module, thus ensuring the ordering of those spans. We won't be looking in them until we've loaded the language portions of that particular module, and even if we did, we'd find NULLs there and issue a diagnostic. PR c++/98843 gcc/cp/ * module.cc (module_state_config): Add num_entities field. (module_state::read_entities): The entity_ary span is already allocated. (module_state::write_config): Write num_entities. (module_state::read_config): Read num_entities. (module_state::write): Set config's num_entities. (module_state::read_initial): Allocate the entity ary span here. (module_state::read_language): Do not set entity_lwm here. gcc/testsuite/ * g++.dg/modules/pr98843_a.C: New. * g++.dg/modules/pr98843_b.H: New. * g++.dg/modules/pr98843_c.C: New.
Diffstat (limited to 'gcc/testsuite/go.test/go-test.exp')
0 files changed, 0 insertions, 0 deletions