]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++/modules: Make bitfield storage unit detection more robust
authorNathaniel Shead <nathanieloshead@gmail.com>
Fri, 27 Jun 2025 08:56:25 +0000 (18:56 +1000)
committerNathaniel Shead <nathanieloshead@gmail.com>
Sat, 28 Jun 2025 14:52:30 +0000 (00:52 +1000)
commitf20f6c796499d097d301104fb2abe49fb77ce492
tree84af736252ef190db744cf17a3fe05dbee1f4acb
parent98fd493db6216cff11142c9dc477a3ff8e4269fa
c++/modules: Make bitfield storage unit detection more robust

Modules streaming needs to handle these differently from other unnamed
FIELD_DECLs that are streamed for internal RECORD_DECLs, and there
doesn't seem to be a good way to detect this case otherwise.

This matters only to allow for compiler-generated type definitions that
build FIELD_DECLs with no name, as otherwise they get confused.
Currently the only such types left I hadn't earlier fixed by giving
names to are contextless, for which we have an early check to mark their
fields as MK_unique anyway, but there may be other cases in the future.

gcc/cp/ChangeLog:

* module.cc (trees_out::walking_bit_field_unit): New flag.
(trees_out::trees_out): Initialize it.
(trees_out::core_vals): Set it.
(trees_out::get_merge_kind): Use it, move previous ad-hoc check
into assertion.

Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
gcc/cp/module.cc