[Ada] Fix Is_Volatile_Function for functions declared in protected bodies
gcc/ada/ * sem_util.adb (Is_Volatile_Function): Follow the exact wording of SPARK (regarding volatile functions) and Ada (regarding protected functions).
This commit is contained in:
parent
1a9ff8d39c
commit
ccf0dee109
1 changed files with 4 additions and 2 deletions
|
@ -21105,9 +21105,11 @@ package body Sem_Util is
|
|||
begin
|
||||
pragma Assert (Ekind (Func_Id) in E_Function | E_Generic_Function);
|
||||
|
||||
-- A function declared within a protected type is volatile
|
||||
-- A protected function is volatile
|
||||
|
||||
if Is_Protected_Type (Scope (Func_Id)) then
|
||||
if Nkind (Parent (Unit_Declaration_Node (Func_Id))) =
|
||||
N_Protected_Definition
|
||||
then
|
||||
return True;
|
||||
|
||||
-- An instance of Ada.Unchecked_Conversion is a volatile function if
|
||||
|
|
Loading…
Add table
Reference in a new issue