if Token = Tok_With then
- if Ada_Version >= Ada_2020 and not Next_Token_Is (Tok_Private) then
-
+ if Next_Token_Is (Tok_Private) then
+ Scan; -- past WITH
+ Set_Private_Present (Def_Node, True);
+ T_Private;
+ else
-- Formal type has aspect specifications, parsed later.
-- Otherwise this is a formal derived type. Note that it may
-- also include later aspect specifications, as in:
- -- type DT is new T with private with atomic;
+ -- type DT is new T with private with Atomic;
- return Def_Node;
+ Error_Msg_Ada_2020_Feature
+ ("formal type with aspect specification", Token_Ptr);
- else
- Scan; -- past WITH
- Set_Private_Present (Def_Node, True);
- T_Private;
+ return Def_Node;
end if;
elsif Token = Tok_Tagged then
if Is_Overriding or else Not_Overriding then
if Ada_Version < Ada_2005 then
- Error_Msg_SP ("overriding indicator is an Ada 2005 extension");
- Error_Msg_SP ("\unit must be compiled with -gnat05 switch");
+ Error_Msg_Ada_2005_Extension ("overriding indicator");
elsif Token = Tok_Entry then
Decl := P_Entry_Declaration;
if Is_Overriding or else Not_Overriding then
if Ada_Version < Ada_2005 then
- Error_Msg_SP ("overriding indicator is an Ada 2005 extension");
- Error_Msg_SP ("\unit must be compiled with -gnat05 switch");
-
+ Error_Msg_Ada_2005_Extension ("overriding indicator");
elsif Token /= Tok_Entry then
Error_Msg_SC -- CODEFIX
("ENTRY expected!");
with Atree; use Atree;
with Csets; use Csets;
+with Errout; use Errout;
with Hostparm; use Hostparm;
with Namet; use Namet;
with Opt; use Opt;
return;
end if;
- when '@' =>
- if Ada_Version < Ada_2020 then
- Error_Msg ("target_name is an Ada 202x feature", Scan_Ptr);
- Scan_Ptr := Scan_Ptr + 1;
+ -- AI12-0125-03 : @ is target_name
- else
- -- AI12-0125-03 : @ is target_name
+ when '@' =>
+ Error_Msg_Ada_2020_Feature ("target name", Token_Ptr);
- Accumulate_Checksum ('@');
- Scan_Ptr := Scan_Ptr + 1;
- Token := Tok_At_Sign;
- return;
- end if;
+ Accumulate_Checksum ('@');
+ Scan_Ptr := Scan_Ptr + 1;
+ Token := Tok_At_Sign;
+ return;
-- Asterisk (can be multiplication operator or double asterisk which
-- is the exponentiation compound delimiter).