c-ada-spec.c (dump_generic_ada_node): Take into account signedness for enumeral types.

* c-ada-spec.c (dump_generic_ada_node): Take into account signedness
	for enumeral types.
	(print_ada_declaration): Add missing guard for record types.

From-SVN: r250714
This commit is contained in:
Eric Botcazou 2017-07-29 09:52:04 +00:00 committed by Eric Botcazou
parent e071b76781
commit 942047f22f
4 changed files with 30 additions and 2 deletions

View File

@ -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

View File

@ -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

View File

@ -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.

View File

@ -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 } } */