summaryrefslogtreecommitdiff
path: root/gcc/ada/par-ch3.adb
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2016-04-14 18:55:01 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2016-04-14 18:55:01 +0000
commitbde1393a7b0583bc123ac962ed2f729b80cd7498 (patch)
treed9e8972ddece739bbdc248c5e33919ded2862cf7 /gcc/ada/par-ch3.adb
parent8f8a206e72c6183084a6792ae98593944dd06fbd (diff)
downloadgcc-bde1393a7b0583bc123ac962ed2f729b80cd7498.tar.gz
2016-04-14 Basile Starynkevitch <basile@starynkevitch.net>
{{merging with even more of GCC 6, using subversion 1.9 svn merge -r228401:229500 ^/trunk }} git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@234985 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/par-ch3.adb')
-rw-r--r--gcc/ada/par-ch3.adb29
1 files changed, 28 insertions, 1 deletions
diff --git a/gcc/ada/par-ch3.adb b/gcc/ada/par-ch3.adb
index 0be12177513..5859bcea05b 100644
--- a/gcc/ada/par-ch3.adb
+++ b/gcc/ada/par-ch3.adb
@@ -3030,8 +3030,23 @@ package body Ch3 is
Set_Discriminant_Type
(Specification_Node,
P_Access_Definition (Not_Null_Present));
- else
+ -- Catch ouf-of-order keywords
+
+ elsif Token = Tok_Constant then
+ Scan;
+
+ if Token = Tok_Access then
+ Error_Msg_SC ("CONSTANT must appear after ACCESS");
+ Set_Discriminant_Type
+ (Specification_Node,
+ P_Access_Definition (Not_Null_Present));
+
+ else
+ Error_Msg_SC ("misplaced CONSTANT");
+ end if;
+
+ else
Set_Discriminant_Type
(Specification_Node, P_Subtype_Mark);
No_Constraint;
@@ -3495,6 +3510,7 @@ package body Ch3 is
end if;
Ident_Sloc := Token_Ptr;
+ Check_Bad_Layout;
Idents (1) := P_Defining_Identifier (C_Comma_Colon);
Num_Idents := 1;
@@ -4425,6 +4441,12 @@ package body Ch3 is
else
Error_Msg_SC ("aspect specifications not allowed here");
+
+ -- Assume that this is a misplaced aspect specification
+ -- within a declarative list. After discarding the
+ -- misplaced aspects we can continue the scan.
+
+ Done := False;
end if;
declare
@@ -4538,6 +4560,11 @@ package body Ch3 is
Scan; -- past RECORD
TF_Semicolon;
+ -- This might happen because of misplaced aspect specification.
+ -- After discarding the misplaced aspects we can continue the
+ -- scan.
+
+ Done := False;
else
Restore_Scan_State (Scan_State); -- to END
Done := True;