aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/decl.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/gcc-interface/decl.c')
-rw-r--r--gcc/ada/gcc-interface/decl.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c
index c243d40..75b0475 100644
--- a/gcc/ada/gcc-interface/decl.c
+++ b/gcc/ada/gcc-interface/decl.c
@@ -8150,13 +8150,20 @@ components_to_record (Node_Id gnat_component_list, Entity_Id gnat_record_type,
5) the variant part,
within the record and within each variant recursively. */
- if (w_reorder
- && last_reorder_field_type == 2
- && tmp_last_reorder_field_type < 2)
- warn_on_field_placement (gnu_tmp_bitp_list
- ? gnu_tmp_bitp_list : gnu_field_list,
- gnat_component_list, gnat_record_type,
- in_variant, do_reorder);
+
+ if (w_reorder)
+ {
+ /* If we have pending bit-packed fields, warn if they would be moved
+ to after regular fields. */
+ if (last_reorder_field_type == 2
+ && tmp_bitp_size != 0
+ && tmp_last_reorder_field_type < 2)
+ warn_on_field_placement (gnu_tmp_bitp_list
+ ? gnu_tmp_bitp_list : gnu_field_list,
+ gnat_component_list, gnat_record_type,
+ in_variant, do_reorder);
+ }
+
if (do_reorder)
{
/* If we have pending bit-packed fields on the temporary list, we put