-- --
------------------------------------------------------------------------------
+with Rident; use Rident;
+with Restrict; use Restrict;
pragma Style_Checks (All_Checks);
-- Turn off subprogram body ordering check. Subprograms are in order
-- by RM section rather than alphabetical
-- The aspect mark is not recognized
if A_Id = No_Aspect then
- Error_Msg_Warn := not Debug_Flag_2;
- Error_Msg_N ("<<& is not a valid aspect identifier", Token_Node);
- OK := False;
-
- -- Check bad spelling
-
- for J in Aspect_Id_Exclude_No_Aspect loop
- if Is_Bad_Spelling_Of (Token_Name, Aspect_Names (J)) then
- Error_Msg_Name_1 := Aspect_Names (J);
- Error_Msg_N -- CODEFIX
- ("\<<possible misspelling of%", Token_Node);
- exit;
+ declare
+ Msg_Issued : Boolean := False;
+ begin
+ Check_Restriction (Msg_Issued, No_Unrecognized_Aspects, Aspect);
+ if not Msg_Issued then
+ Error_Msg_Warn := not Debug_Flag_2;
+ Error_Msg_N
+ ("<<& is not a valid aspect identifier", Token_Node);
+ OK := False;
+
+ -- Check bad spelling
+
+ for J in Aspect_Id_Exclude_No_Aspect loop
+ if Is_Bad_Spelling_Of (Token_Name, Aspect_Names (J)) then
+ Error_Msg_Name_1 := Aspect_Names (J);
+ Error_Msg_N -- CODEFIX
+ ("\<<possible misspelling of%", Token_Node);
+ exit;
+ end if;
+ end loop;
end if;
- end loop;
+ end;
Scan; -- past incorrect identifier