===================================================================
@@ -3030,8 +3030,23 @@
Set_Discriminant_Type
(Specification_Node,
P_Access_Definition (Not_Null_Present));
+
+ -- 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;