-- access_definition
elsif Token = Tok_Renames then
- if Ada_Version < Ada_2020 then
- Error_Msg_SC
- ("object renaming without subtype is an Ada 202x feature");
- Error_Msg_SC ("\compile with -gnat2020");
- end if;
+ Error_Msg_Ada_2020_Feature
+ ("object renaming without subtype", Token_Ptr);
Scan; -- past renames
Scan; -- past minus
when Tok_At_Sign => -- AI12-0125 : target_name
- if Ada_Version < Ada_2020 then
- Error_Msg_SC ("target name is an Ada 202x feature");
- Error_Msg_SC ("\compile with -gnat2020");
- end if;
+ Error_Msg_Ada_2020_Feature ("target name", Token_Ptr);
Node1 := P_Name;
return Node1;
Set_Expression (Assoc_Node, P_Expression);
end if;
- if Ada_Version < Ada_2020 then
- Error_Msg_SC ("iterated component is an Ada 202x feature");
- Error_Msg_SC ("\compile with -gnat2020");
- end if;
+ Error_Msg_Ada_2020_Feature ("iterated component", Token_Ptr);
return Assoc_Node;
end P_Iterated_Component_Association;
Result : constant Node_Id :=
Make_Expression_With_Actions (Loc, Actions, Expression);
begin
- if Ada_Version < Ada_2020 then
- Error_Msg ("declare_expression is an Ada 2020 feature", Loc);
- end if;
+ Error_Msg_Ada_2020_Feature ("declare expression", Loc);
return Result;
end;
-- the time being.
elsif Token = Tok_With then
- if Ada_Version < Ada_2020 then
- Error_Msg_SP ("aspect on formal parameter requires -gnat2020");
- end if;
+ Error_Msg_Ada_2020_Feature
+ ("aspect on formal parameter", Token_Ptr);
P_Aspect_Specifications (Specification_Node, False);
Base : constant Node_Id := Expression (N);
begin
- if Ada_Version < Ada_2020 then
- Error_Msg_N ("delta_aggregate is an Ada 202x feature", N);
- Error_Msg_N ("\compile with -gnat2020", N);
- end if;
+ Error_Msg_Ada_2020_Feature ("delta aggregate", Sloc (N));
if not Is_Composite_Type (Typ) then
Error_Msg_N ("not a composite type", N);
Assign_Indexed_Subp : Node_Id := Empty;
begin
- if Ada_Version < Ada_2020 then
- Error_Msg_N ("Aspect Aggregate is an Ada_2020 feature", N);
+ Error_Msg_Ada_2020_Feature ("aspect Aggregate", Sloc (N));
- elsif Nkind (N) /= N_Aggregate
+ if Nkind (N) /= N_Aggregate
or else Present (Expressions (N))
or else No (Component_Associations (N))
then
- Error_Msg_N ("Aspect Aggregate requires an aggregate "
+ Error_Msg_N ("aspect Aggregate requires an aggregate "
& "with component associations", N);
return;
end if;
PF_Name : Node_Id := PF_Arg;
- -- Start of processing for Check_Property_Function_Arg
+ -- Start of processing for Check_Property_Function_Arg
+
begin
if Nkind (PF_Arg) = N_Op_Not then
PF_Name := Right_Opnd (PF_Arg);
end if;
end Check_Property_Function_Arg;
+ -- Start of processing for Validate_Aspect_Stable_Properties
+
begin
- if Ada_Version < Ada_2020 then
- Error_Msg_N ("Aspect Stable_Properties is an Ada_2020 feature", N);
- end if;
+ Error_Msg_Ada_2020_Feature ("aspect Stable_Properties", Sloc (N));
if (not Is_Aspect_Of_Type) and then (not Is_Subprogram (E)) then
Error_Msg_N ("Stable_Properties aspect can only be specified for "
-- AI12-0383: Names that denote values can be renamed.
-- Ignore (accept) N_Raise_xxx_Error nodes in this context.
- elsif Ada_Version < Ada_2020
- and then No_Raise_xxx_Error (Nam) = OK
- then
- Error_Msg_N ("value in renaming requires -gnat2020", Nam);
+ elsif No_Raise_xxx_Error (Nam) = OK then
+ Error_Msg_Ada_2020_Feature ("value in renaming", Sloc (Nam));
end if;
Set_Etype (Id, T2);