Functions with aspect Side_Effects should not reference attribute Result in
consequences of their aspect Exceptional_Cases.
gcc/ada/ChangeLog:
* sem_prag.adb (Analyze_Exceptional_Cases_In_Decl_Part): Reject
references to attribute Result.
-- in the consequences of an exceptional contract unless they are either
-- passed by reference or occur in the prefix of a reference to the 'Old
-- attribute or as direct prefixes of attributes that do not actually
- -- read data from the object (SPARK RM 6.1.9(1)).
+ -- read data from the object (SPARK RM 6.1.9(1)). References to
+ -- attribute Result should not occur either.
-----------------
-- Check_Param --
then
return Skip;
end if;
+ when Name_Result =>
+ Error_Msg_N
+ ("attribute Result in consequence of Exceptional_Cases",
+ N);
when others => null;
end case;