aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.cc
diff options
context:
space:
mode:
authorJavier Miranda <miranda@adacore.com>2024-05-03 17:52:20 +0000
committerMarc Poulhiès <poulhies@adacore.com>2024-06-13 15:30:34 +0200
commitdf898445c211cb417fad784d50a68bae0f20acbc (patch)
treead0bfa00064a29922a491b6a1e7eb2543223aa41 /gcc/expr.cc
parent0662d7426835a69bf233c3f9a025b30e84563ff2 (diff)
downloadgcc-df898445c211cb417fad784d50a68bae0f20acbc.zip
gcc-df898445c211cb417fad784d50a68bae0f20acbc.tar.gz
gcc-df898445c211cb417fad784d50a68bae0f20acbc.tar.bz2
ada: Missing postcondition runtime check in inherited primitive
When a derived tagged type implements more interface interface types than its parent type, and a primitive inherited from its parent type covers a primitive of these additional interface types that has classwide postconditions, the code generated by the compiler does not check the classwide postconditions inherited from the interface primitive. gcc/ada/ * freeze.ads (Check_Condition_Entities): Complete documentation. * freeze.adb (Check_Inherited_Conditions): Extend its functionality to build two kind of wrappers: the existing LSP wrappers, and wrappers required to handle postconditions of interface primitives implemented by inherited primitives. (Build_Inherited_Condition_Pragmas): Rename formal. (Freeze_Record_Type): For derived tagged types, move call to Check_Inherited_Conditions to subprogram Freeze_Entity_Checks; done to improve the performance of Check_Inherited_Conditions since it can rely on the internal entities that link interface primitives with tagged type primitives that implement them. (Check_Interface_Primitives_Strub_Mode): New subprogram. * sem_ch13.adb (Freeze_Entity_Checks): Call Check_Inherited_Conditions. Call Check_Inherited_Conditions with derived interface types to check strub mode compatibility of their primitives. * sem_disp.adb (Check_Dispatching_Operation): Adjust assertion to accept wrappers of interface primitives that have classwide postconditions. * exp_disp.adb (Write_DT): Adding text to identify wrappers.
Diffstat (limited to 'gcc/expr.cc')
0 files changed, 0 insertions, 0 deletions