[Ada] Ada_2020 AI12-0220 Pre/Postconditions on Access_To_Subprogram types
authorEd Schonberg <schonberg@adacore.com>
Sun, 12 Apr 2020 14:34:46 +0000 (10:34 -0400)
committerPierre-Marie de Rodat <derodat@adacore.com>
Wed, 17 Jun 2020 08:14:09 +0000 (04:14 -0400)
commit7b6a7ef8ad0e180b2f12b2a1535b31d0acc83f1c
tree85a56e34522c2694fee91201b799a611ac506a5c
parent73642e6899a36de223ea07292e8e7236fb22aee7
[Ada] Ada_2020 AI12-0220 Pre/Postconditions on Access_To_Subprogram types

2020-06-17  Ed Schonberg  <schonberg@adacore.com>

gcc/ada/

* sem_ch3.adb (Analyze_Full_Type_Declaration): For an
access_to_subprogram declaration that has aspect specifications,
call Build_Access_ Subprogram_Wrapper at once, so that pre- and
postcondition aspects are analyzed in the context of a
subprogram declaration.
(Build_Access_Subprogram_Wrapper): Examine aspect specifications
of an Access_To_Subprogram declaration. If pre- or
postconditions are declared for it, create declaration for
subprogram wrapper and add the corresponding aspect
specifications to it. Replace occurrences of the type name by
that of the generated subprogram, so that attributes 'Old and
'Result can appear in a postcondition.
* exp_ch3.adb (Build_Access_Subprogram_Wrapper_Body): Moved
here from sem_prag.adb.
* exp_ch3.ads (Build_Access_Subprogram_Wrapper_Body): Visible
subprogram.
* sem_prag.adb (Build_Access_Subprogram_Wrapper / _Body): Moved
to sem_ch3.adb and exp_ch3.adb.
gcc/ada/exp_ch3.adb
gcc/ada/exp_ch3.ads
gcc/ada/sem_ch3.adb
gcc/ada/sem_prag.adb