aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/c-family/ChangeLog6
-rw-r--r--gcc/c-family/c-ada-spec.c7
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/c-c++-common/dump-ada-spec-7.c15
4 files changed, 30 insertions, 2 deletions
diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog
index c05ca12..88752a8 100644
--- a/gcc/c-family/ChangeLog
+++ b/gcc/c-family/ChangeLog
@@ -1,3 +1,9 @@
+2017-07-29 Eric Botcazou <ebotcazou@adacore.com>
+
+ * c-ada-spec.c (dump_generic_ada_node): Take into account signedness
+ for enumeral types.
+ (print_ada_declaration): Add missing guard for record types.
+
2017-07-27 Jakub Jelinek <jakub@redhat.com>
PR c/45784
diff --git a/gcc/c-family/c-ada-spec.c b/gcc/c-family/c-ada-spec.c
index d39501c..de54950 100644
--- a/gcc/c-family/c-ada-spec.c
+++ b/gcc/c-family/c-ada-spec.c
@@ -2055,7 +2055,10 @@ dump_generic_ada_node (pretty_printer *buffer, tree node, tree type, int spc,
}
else
{
- pp_string (buffer, "unsigned");
+ if (TYPE_UNSIGNED (node))
+ pp_string (buffer, "unsigned");
+ else
+ pp_string (buffer, "int");
for (; value; value = TREE_CHAIN (value))
{
pp_semicolon (buffer);
@@ -3097,7 +3100,7 @@ print_ada_declaration (pretty_printer *buffer, tree t, tree type, int spc)
if (TYPE_NAME (TREE_TYPE (t)))
dump_generic_ada_node
(buffer, TREE_TYPE (t), t, spc, false, true);
- else
+ else if (type)
dump_ada_double_name (buffer, type, t);
}
else
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 8e83a73..20ea9de 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2017-07-29 Eric Botcazou <ebotcazou@adacore.com>
+
+ * c-c++-common/dump-ada-spec-7.c: New test.
+
2017-07-29 Jakub Jelinek <jakub@redhat.com>
* g++.dg/debug/dwarf2/inline-ns-1.C: New test.
diff --git a/gcc/testsuite/c-c++-common/dump-ada-spec-7.c b/gcc/testsuite/c-c++-common/dump-ada-spec-7.c
new file mode 100644
index 0000000..515d259
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/dump-ada-spec-7.c
@@ -0,0 +1,15 @@
+/* { dg-do compile } */
+/* { dg-options "-fdump-ada-spec" } */
+
+enum E1 {
+ A1 = -1L,
+ A2 = 0,
+ A3 = 1
+};
+
+static enum {B1 = -1L, B2, B3} Obj1;
+
+static struct { int i; } Obj2;
+
+/* { dg-final { scan-ada-spec-not "unsigned" } } */
+/* { dg-final { cleanup-ada-spec } } */