]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++/modules: Propagate some missing flags on type definitions
authorNathaniel Shead <nathanieloshead@gmail.com>
Thu, 24 Oct 2024 07:10:52 +0000 (18:10 +1100)
committerNathaniel Shead <nathanieloshead@gmail.com>
Thu, 24 Oct 2024 21:38:00 +0000 (08:38 +1100)
commit6aba48a8cc128e54ee243d451ac9a843ff41c4f9
tree6379c1e242a9ab4a1c0f76b060a81d2ecdb8ded9
parent29efc621b7c66ec67d10fc87cddbb3f1ab709fb2
c++/modules: Propagate some missing flags on type definitions

Noticed while testing my fix for PR c++/113814.  Not all of these are
easily testable but I've tested a couple that were straight-forward.

For consistency also adds a new TYPE_WARN_IF_NOT_ALIGN_RAW flag to match
the decl version Nathan added.

gcc/cp/ChangeLog:

* module.cc (trees_in::read_class_def): Propagate some missing
flags from the streamed-in definition.

gcc/ChangeLog:

* tree.h (TYPE_WARN_IF_NOT_ALIGN_RAW): New accessor.
(TYPE_WARN_IF_NOT_ALIGN): Use it.
(SET_TYPE_WARN_IF_NOT_ALIGN): Likewise.

gcc/testsuite/ChangeLog:

* g++.dg/modules/class-10_a.H: New test.
* g++.dg/modules/class-10_b.C: New test.

Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
gcc/cp/module.cc
gcc/testsuite/g++.dg/modules/class-10_a.H [new file with mode: 0644]
gcc/testsuite/g++.dg/modules/class-10_b.C [new file with mode: 0644]
gcc/tree.h