aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_ch3.ads
diff options
context:
space:
mode:
authorJavier Miranda <miranda@adacore.com>2024-09-30 09:08:04 +0000
committerMarc Poulhiès <dkm@gcc.gnu.org>2024-10-25 11:09:02 +0200
commit13a4eb2548a9907fd5c57c1e4b51b22411066cf0 (patch)
treeb72721fcc9834cbf61f85ae32e47201ea170da36 /gcc/ada/sem_ch3.ads
parent257d0d7769c29639c8bd07c986e36283f0a0ab8a (diff)
downloadgcc-13a4eb2548a9907fd5c57c1e4b51b22411066cf0.zip
gcc-13a4eb2548a9907fd5c57c1e4b51b22411066cf0.tar.gz
gcc-13a4eb2548a9907fd5c57c1e4b51b22411066cf0.tar.bz2
ada: Pragma Pre_Class and Post_Class have no effect at runtime
The pragmas Pre_Class and Post_Class are accepted by the compiler but have no effect at runtime. gcc/ada/ChangeLog: * freeze.adb (Freeze_Entity): If the entity is an access-to-subprogram type declaration that pre/postcondition contracts, build the wrapper (if not previously done as part of processing aspects). * sem_ch3.adb (Build_Access_Subprogram_Wrapper): Add missing support for building the wrapper when the access type has pragmas Pre_Class/Post_Class. (Build_Access_Subprogram_Wrapper_Declaration): New subprogram. * sem_ch3.ads (Build_Access_Subprogram_Wrapper): Spec moved to the public part of the package. * sem_prag.adb (Analyze_Pre_Post_Condition): Store in the tree copy of class-wide pre/postcondition expression; required to merge it with inherited conditions. (Is_Valid_Assertion_Kind): Added Pre_Class and Post_Class.
Diffstat (limited to 'gcc/ada/sem_ch3.ads')
-rw-r--r--gcc/ada/sem_ch3.ads5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/ada/sem_ch3.ads b/gcc/ada/sem_ch3.ads
index 4cc125a..b0c9c13 100644
--- a/gcc/ada/sem_ch3.ads
+++ b/gcc/ada/sem_ch3.ads
@@ -85,6 +85,11 @@ package Sem_Ch3 is
procedure Access_Type_Declaration (T : Entity_Id; Def : Node_Id);
-- Process an access type declaration
+ procedure Build_Access_Subprogram_Wrapper (Decl : Node_Id);
+ -- When an access-to-subprogram type has pre/postconditions, we build a
+ -- subprogram that includes these contracts and is invoked by an indirect
+ -- call through the corresponding access type.
+
procedure Build_Itype_Reference (Ityp : Entity_Id; Nod : Node_Id);
-- Create a reference to an internal type, for use by Gigi. The back-end
-- elaborates itypes on demand, i.e. when their first use is seen. This can