aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.h
diff options
context:
space:
mode:
authorNathaniel Shead <nathanieloshead@gmail.com>2024-10-24 18:10:52 +1100
committerNathaniel Shead <nathanieloshead@gmail.com>2024-10-25 08:38:00 +1100
commit6aba48a8cc128e54ee243d451ac9a843ff41c4f9 (patch)
tree6379c1e242a9ab4a1c0f76b060a81d2ecdb8ded9 /gcc/tree.h
parent29efc621b7c66ec67d10fc87cddbb3f1ab709fb2 (diff)
downloadgcc-6aba48a8cc128e54ee243d451ac9a843ff41c4f9.zip
gcc-6aba48a8cc128e54ee243d451ac9a843ff41c4f9.tar.gz
gcc-6aba48a8cc128e54ee243d451ac9a843ff41c4f9.tar.bz2
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>
Diffstat (limited to 'gcc/tree.h')
-rw-r--r--gcc/tree.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/gcc/tree.h b/gcc/tree.h
index efda032..66e08793 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -2357,13 +2357,15 @@ extern tree vector_element_bits_tree (const_tree);
/* The minimum alignment necessary for objects of this type without
warning. The value is an int, measured in bits. */
+#define TYPE_WARN_IF_NOT_ALIGN_RAW(NODE) \
+ (TYPE_CHECK (NODE)->type_common.warn_if_not_align)
#define TYPE_WARN_IF_NOT_ALIGN(NODE) \
- (TYPE_CHECK (NODE)->type_common.warn_if_not_align \
- ? ((unsigned)1) << ((NODE)->type_common.warn_if_not_align - 1) : 0)
+ (TYPE_WARN_IF_NOT_ALIGN_RAW (NODE) \
+ ? ((unsigned)1) << (TYPE_WARN_IF_NOT_ALIGN_RAW (NODE) - 1) : 0)
/* Specify that TYPE_WARN_IF_NOT_ALIGN(NODE) is X. */
#define SET_TYPE_WARN_IF_NOT_ALIGN(NODE, X) \
- (TYPE_CHECK (NODE)->type_common.warn_if_not_align = ffs_hwi (X))
+ (TYPE_WARN_IF_NOT_ALIGN_RAW (NODE) = ffs_hwi (X))
/* If your language allows you to declare types, and you want debug info
for them, then you need to generate corresponding TYPE_DECL nodes.