aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sprint.adb
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada/sprint.adb')
-rw-r--r--gcc/ada/sprint.adb10
1 files changed, 9 insertions, 1 deletions
diff --git a/gcc/ada/sprint.adb b/gcc/ada/sprint.adb
index 8e33462..f2ad1ec 100644
--- a/gcc/ada/sprint.adb
+++ b/gcc/ada/sprint.adb
@@ -2247,7 +2247,15 @@ package body Sprint is
Write_Str_With_Col_Check ("not null ");
end if;
- Sprint_Node (Object_Definition (Node));
+ -- Print type, we used to print the Object_Definition from
+ -- the node, but it is much more useful to print the Etype
+ -- of the defining identifier. For example, this will be a
+ -- clear reference to the Itype with the bounds in the case
+ -- of an unconstrained array type like String. The object
+ -- after all is constrained, even if its nominal subtype is
+ -- unconstrained.
+
+ Sprint_Node (Etype (Def_Id));
if Present (Expression (Node)) then
Write_Str (" := ");