diff options
author | Gary Dismukes <dismukes@adacore.com> | 2020-01-24 14:11:47 -0500 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2020-06-04 05:11:10 -0400 |
commit | 4f31d6dbb8deafd7ab54e70eddfd931b10b3309b (patch) | |
tree | fc6f000859ceafe678afb79e961ac60f729e277d /gcc/ada/sprint.adb | |
parent | 96cd8940614e0f87aca7bb6064a45710aca6212f (diff) |
[Ada] Implement AI12-0275 (Make subtype_mark optional in object renamings)
2020-06-04 Gary Dismukes <dismukes@adacore.com>
gcc/ada/
* par-ch3.adb (P_Identifier_Declarations): Add parsing of object
renamings that have neither a subtype_mark nor an
access_definition. Issue an error if the version is earlier than
Ada_2020, and suggest using -gnatX.
* sem_ch8.adb (Analyze_Object_Renaming): Handle
object_renaming_declarations that don't have an explicit
subtype. Errors are issued when the name is inappropriate or
ambiguous, and otherwise the Etype of the renaming entity is set
from the Etype of the renamed object.
* sem_util.adb (Has_Null_Exclusion): Allow for the case of no
subtype given in an N_Object_Renaming_Declaration.
* sprint.adb (Sprint_Node_Actual): Handle printing of
N_Object_Renaming_Declarations that are specified without an
explicit subtype.
Diffstat (limited to 'gcc/ada/sprint.adb')
-rw-r--r-- | gcc/ada/sprint.adb | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/ada/sprint.adb b/gcc/ada/sprint.adb index 51f0bf41022..f177981de70 100644 --- a/gcc/ada/sprint.adb +++ b/gcc/ada/sprint.adb @@ -2441,14 +2441,15 @@ package body Sprint is Write_Indent; Set_Debug_Sloc; Sprint_Node (Defining_Identifier (Node)); - Write_Str (" : "); -- Ada 2005 (AI-230): Access renamings if Present (Access_Definition (Node)) then + Write_Str (" : "); Sprint_Node (Access_Definition (Node)); elsif Present (Subtype_Mark (Node)) then + Write_Str (" : "); -- Ada 2005 (AI-423): Object renaming with a null exclusion @@ -2458,8 +2459,13 @@ package body Sprint is Sprint_Node (Subtype_Mark (Node)); + -- AI12-0275: Object_Renaming_Declaration without explicit subtype + + elsif Ada_Version >= Ada_2020 then + null; + else - Write_Str (" ??? "); + Write_Str (" : ??? "); end if; Write_Str_With_Col_Check (" renames "); |