summaryrefslogtreecommitdiff
path: root/gcc/ada/sprint.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2014-07-17 06:52:30 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2014-07-17 06:52:30 +0000
commit6ff6ab624bdd66d09bd25511e9d32e7384d1a85b (patch)
tree932722f0610e4afe2d75cad3ac2d6ee7f8b0fee4 /gcc/ada/sprint.adb
parent05cb7beb3a083188a9495c03e2f70924264f96ea (diff)
downloadgcc-6ff6ab624bdd66d09bd25511e9d32e7384d1a85b.tar.gz
2014-07-17 Vincent Celier <celier@adacore.com>
* gnatbind.adb: Change in message "try ... for more information". 2014-07-17 Robert Dewar <dewar@adacore.com> * sprint.adb: Code clean up. 2014-07-17 Hristian Kirtchev <kirtchev@adacore.com> * exp_ch7.adb (Find_Last_Init): Relocate local variables to the relevant code section. Add new local constant Obj_Id. When a limited controlled object is initialized by a function call, the build-in-place object access function call acts as the last initialization statement. * exp_util.adb (Is_Object_Access_BIP_Func_Call): New routine. (Is_Secondary_Stack_BIP_Func_Call): Code reformatting. * exp_util.ads (Is_Object_Access_BIP_Func_Call): New routine. 2014-07-17 Ed Schonberg <schonberg@adacore.com> * sem_ch8.adb (Analyze_Generic_Renaming): For generic subprograms, propagate intrinsic flag to renamed entity, to allow e.g. renaming of Unchecked_Conversion. * sem_ch3.adb (Analyze_Declarations): Do not analyze contracts if the declaration has errors. 2014-07-17 Ed Schonberg <schonberg@adacore.com> * a-rbtgbk.adb: a-rbtgbk.adb (Generic_Insert_Post): Check whether container is busy before checking whether capacity allows for a further insertion. Insertion in a busy container that is full raises Program_Error rather than Capacity_Error. Previous to that patch which exception was raised varied among container types. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@212730 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/sprint.adb')
-rw-r--r--gcc/ada/sprint.adb27
1 files changed, 22 insertions, 5 deletions
diff --git a/gcc/ada/sprint.adb b/gcc/ada/sprint.adb
index f2ad1ec6f45..9a55e8cc65a 100644
--- a/gcc/ada/sprint.adb
+++ b/gcc/ada/sprint.adb
@@ -2249,13 +2249,30 @@ package body Sprint is
-- 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
+ -- of the defining identifier for the case where the nominal
+ -- type is an unconstrained array type. For example, this
+ -- will be a clear reference to the Itype with the bounds
+ -- in the case of a type like String. The object after
+ -- all is constrained, even if its nominal subtype is
-- unconstrained.
- Sprint_Node (Etype (Def_Id));
+ declare
+ Odef : constant Node_Id := Object_Definition (Node);
+
+ begin
+ if Nkind (Odef) = N_Identifier
+ and then Is_Array_Type (Etype (Odef))
+ and then not Is_Constrained (Etype (Odef))
+ and then Present (Etype (Def_Id))
+ then
+ Sprint_Node (Etype (Def_Id));
+
+ -- In other cases, the nominal type is fine to print
+
+ else
+ Sprint_Node (Odef);
+ end if;
+ end;
if Present (Expression (Node)) then
Write_Str (" := ");