if Result_Definition (N) /= Error then
if Nkind (Result_Definition (N)) = N_Access_Definition then
-
Check_Formal_Restriction
("access result is not allowed", Result_Definition (N));
then
Check_Formal_Restriction
("returning an unconstrained array is not allowed",
- Result_Definition (N));
+ Result_Definition (N));
end if;
-- Ada 2005 (AI-231): Ensure proper usage of null exclusion
-- Special checks in formal mode
if Nkind (Body_Spec) = N_Function_Specification then
- -- In formal mode, the last statement of a function should be a
- -- return statement.
+
+ -- In formal mode, last statement of a function should be a return
declare
Stat : constant Node_Id := Last_Source_Statement (HSS);
begin
if Present (Stat)
- and then not Nkind_In (Stat,
- N_Simple_Return_Statement,
- N_Extended_Return_Statement)
+ and then not Nkind_In (Stat, N_Simple_Return_Statement,
+ N_Extended_Return_Statement)
then
Check_Formal_Restriction
("last statement in function should be RETURN", Stat);
Default := Expression (Param_Spec);
if Present (Default) then
-
Check_Formal_Restriction
("default expression is not allowed", Default);
Set_Hidden_By_Use_Clause (N, No_Elist);
- -- Use clause is not allowed in a spec of a predefined package
- -- declaration except that packages whose file name starts a-n are OK
- -- (these are children of Ada.Numerics, and such packages are never
- -- loaded by Rtsfind).
+ -- Use clause not allowed in a spec of a predefined package declaration
+ -- except that packages whose file name starts a-n are OK (these are
+ -- children of Ada.Numerics, which are never loaded by Rtsfind).
if Is_Predefined_File_Name (Unit_File_Name (Current_Sem_Unit))
and then Name_Buffer (1 .. 3) /= "a-n"