diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2011-08-02 09:42:46 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2011-08-02 09:42:46 +0200 |
commit | 9f90d12301fa640d4664b7924cbacb75e9e304d2 (patch) | |
tree | 72abc89b907673e095c09bd0dd495a685a603aeb /gcc/ada/par-endh.adb | |
parent | 390fa58886e1151f7844702ad2525febc18cfbf1 (diff) | |
download | gcc-9f90d12301fa640d4664b7924cbacb75e9e304d2.zip gcc-9f90d12301fa640d4664b7924cbacb75e9e304d2.tar.gz gcc-9f90d12301fa640d4664b7924cbacb75e9e304d2.tar.bz2 |
[multiple changes]
2011-08-02 Robert Dewar <dewar@adacore.com>
* gnat_rm.texi: Minor reformatting.
* sem_prag.adb: Minor reformatting.
2011-08-02 Tristan Gingold <gingold@adacore.com>
* vms_data.ads: Add VMS qualifier for -gnateP.
2011-08-02 Robert Dewar <dewar@adacore.com>
* par-ch13.adb (P_Aspect_Specification): New meaning of Decl = Empty
* par-ch7.adb (P_Package): Proper placement of aspects for package
decl/instantiation.
* par-endh.adb (Check_End): Ad Is_Sloc parameter
(End_Statements): Add Is_Sloc parameterr
* par.adb (P_Aspect_Specification): New meaning of Decl = Empty
(Check_End): Ad Is_Sloc parameter
(End_Statements): Add Is_Sloc parameterr
2011-08-02 Vincent Celier <celier@adacore.com>
* ug_words: Add VMS qualifier equivalent to -gnateP:
/SYMBOL_PREPROCESSING.
2011-08-02 Jose Ruiz <ruiz@adacore.com>
* gnat-style.texi: For hexadecimal numeric literals the typical
grouping of digits is 4 to represent 2 bytes.
A procedure spec which is split into several lines is indented two
characters.
2011-08-02 Yannick Moy <moy@adacore.com>
* exp_aggr.adb (Is_Others_Aggregate): move function to other unit.
* sem_aggr.adb, sem_aggr.ads (Is_Others_Aggregate): move function here
(Resolve_Aggregate): issue errors in formal modes when aggregate is not
properly qualified
(Resolve_Array_Aggregate): issue errors in formal modes on non-static
choice in array aggregate
(Resolve_Extension_Aggregate): issue errors in formal modes on subtype
mark as ancestor
(Resolve_Record_Aggregate): issue errors in formal modes on mixed
positional and named aggregate for record, or others in record
aggregate, or multiple choice in record aggregate
* sem_res.adb (Resolve_Logical_Op): issue errors in formal mode when
array operands to logical operations AND, OR and XOR do not have the
same static lower and higher bounds
* sem_ch5.adb, sinfo.ads: Correct typos in comments
From-SVN: r177086
Diffstat (limited to 'gcc/ada/par-endh.adb')
-rw-r--r-- | gcc/ada/par-endh.adb | 36 |
1 files changed, 30 insertions, 6 deletions
diff --git a/gcc/ada/par-endh.adb b/gcc/ada/par-endh.adb index 12c5509..8b0897e 100644 --- a/gcc/ada/par-endh.adb +++ b/gcc/ada/par-endh.adb @@ -166,7 +166,10 @@ package body Endh is -- Check_End -- --------------- - function Check_End (Decl : Node_Id := Empty) return Boolean is + function Check_End + (Decl : Node_Id := Empty; + Is_Loc : Source_Ptr := No_Location) return Boolean + is Name_On_Separate_Line : Boolean; -- Set True if the name on an END line is on a separate source line -- from the END. This is highly suspicious, but is allowed. The point @@ -401,11 +404,31 @@ package body Endh is if End_Type /= E_Record then - -- Scan aspect specifications if permitted here + -- Scan aspect specifications if Aspect_Specifications_Present then + + -- Aspect specifications not allowed + if No (Decl) then - P_Aspect_Specifications (Error); + + -- Package declaration case + + if Is_Loc /= No_Location then + Error_Msg_SC + ("misplaced aspects for package declaration"); + Error_Msg + ("info: aspect specifications belong here", Is_Loc); + P_Aspect_Specifications (Empty); + + -- Other cases where aspect specifications are not allowed + + else + P_Aspect_Specifications (Error); + end if; + + -- Aspect specifications allowed + else P_Aspect_Specifications (Decl); end if; @@ -664,15 +687,16 @@ package body Endh is -- Error recovery: cannot raise Error_Resync; procedure End_Statements - (Parent : Node_Id := Empty; - Decl : Node_Id := Empty) + (Parent : Node_Id := Empty; + Decl : Node_Id := Empty; + Is_Sloc : Source_Ptr := No_Location) is begin -- This loop runs more than once in the case where Check_End rejects -- the END sequence, as indicated by Check_End returning False. loop - if Check_End (Decl) then + if Check_End (Decl, Is_Sloc) then if Present (Parent) then Set_End_Label (Parent, End_Labl); end if; |