aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2008-01-26 09:29:00 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2008-01-26 09:29:00 +0000
commit8fa07a56dfd1e9a357e5ee498d55097d76695628 (patch)
treee7cb024a6c585494a1e5f6dee1b5013f57ef9586 /gcc
parentd79ca2074fdb83ace6f79ccf3530285d8b15be8c (diff)
downloadgcc-8fa07a56dfd1e9a357e5ee498d55097d76695628.zip
gcc-8fa07a56dfd1e9a357e5ee498d55097d76695628.tar.gz
gcc-8fa07a56dfd1e9a357e5ee498d55097d76695628.tar.bz2
decl.c (components_to_record): Improve comment.
* decl.c (components_to_record): Improve comment. From-SVN: r131858
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ada/ChangeLog4
-rw-r--r--gcc/ada/decl.c5
2 files changed, 7 insertions, 2 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 9db0f84..1183d0f 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,7 @@
+2008-01-26 Eric Botcazou <ebotcazou@adacore.com>
+
+ * decl.c (components_to_record): Improve comment.
+
2008-01-22 Eric Botcazou <ebotcazou@adacore.com>
* decl.c (components_to_record): Do not reuse the empty union type
diff --git a/gcc/ada/decl.c b/gcc/ada/decl.c
index c57e145..9945e4e 100644
--- a/gcc/ada/decl.c
+++ b/gcc/ada/decl.c
@@ -6066,8 +6066,9 @@ components_to_record (tree gnu_record_type, Node_Id component_list,
Set_Present_Expr (variant, annotate_value (gnu_qual));
/* If this is an Unchecked_Union and we have exactly one field,
- use that field here. */
- if (unchecked_union && TYPE_FIELDS (gnu_variant_type)
+ use this field directly to match the layout of C unions. */
+ if (unchecked_union
+ && TYPE_FIELDS (gnu_variant_type)
&& !TREE_CHAIN (TYPE_FIELDS (gnu_variant_type)))
gnu_field = TYPE_FIELDS (gnu_variant_type);
else