aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/par-ch6.adb
diff options
context:
space:
mode:
authorGhjuvan Lacambre <lacambre@adacore.com>2020-11-18 11:23:05 +0100
committerPierre-Marie de Rodat <derodat@adacore.com>2020-12-14 10:51:51 -0500
commit9189557557feb9439d6ab0aff2b8dbedea97a15a (patch)
tree5712310d8cd60ce029bd5dc7c96caebb098e4914 /gcc/ada/par-ch6.adb
parent097826df0cb9333f06bc857a1c02a8842d0de7fd (diff)
downloadgcc-9189557557feb9439d6ab0aff2b8dbedea97a15a.zip
gcc-9189557557feb9439d6ab0aff2b8dbedea97a15a.tar.gz
gcc-9189557557feb9439d6ab0aff2b8dbedea97a15a.tar.bz2
[Ada] Implement AI12-0398-1/03
gcc/ada/ * par-ch3.adb (P_Discriminant_Part_Opt): Parse aspects, update documentation. * par-ch6.adb (P_Return_Statement): Likewise. * par-ch9.adb (P_Entry_Index_Specification): Likewise.
Diffstat (limited to 'gcc/ada/par-ch6.adb')
-rw-r--r--gcc/ada/par-ch6.adb12
1 files changed, 9 insertions, 3 deletions
diff --git a/gcc/ada/par-ch6.adb b/gcc/ada/par-ch6.adb
index 0fcd23a..f65c6f6 100644
--- a/gcc/ada/par-ch6.adb
+++ b/gcc/ada/par-ch6.adb
@@ -1770,7 +1770,8 @@ package body Ch6 is
--
-- EXTENDED_RETURN_STATEMENT ::=
-- return DEFINING_IDENTIFIER : [aliased] RETURN_SUBTYPE_INDICATION
- -- [:= EXPRESSION] [do
+ -- [:= EXPRESSION]
+ -- [ASPECT_SPECIFICATION] [do
-- HANDLED_SEQUENCE_OF_STATEMENTS
-- end return];
--
@@ -1916,6 +1917,7 @@ package body Ch6 is
Ret_Sloc : constant Source_Ptr := Token_Ptr;
Ret_Strt : constant Column_Number := Start_Column;
Ret_Node : Node_Id;
+ Decl : Node_Id;
-- Start of processing for P_Return_Statement
@@ -1955,8 +1957,12 @@ package body Ch6 is
end if;
Ret_Node := New_Node (N_Extended_Return_Statement, Ret_Sloc);
- Set_Return_Object_Declarations
- (Ret_Node, New_List (P_Return_Object_Declaration));
+ Decl := P_Return_Object_Declaration;
+ Set_Return_Object_Declarations (Ret_Node, New_List (Decl));
+
+ if Token = Tok_With then
+ P_Aspect_Specifications (Decl, False);
+ end if;
if Token = Tok_Do then
Push_Scope_Stack;