[Ada] Crash in class-wide pre/postconditions
gcc/ada/
* atree.ads (Traverse_Func_With_Parent): New generic subprogram.
(Traverse_Proc_With_Parent): Likewise.
* atree.adb (Parents_Stack): New table used to traverse trees
passing the parent field of each node.
(Internal_Traverse_With_Parent): New generic subprogram.
(Traverse_Func_With_Parent): Likewise.
(Traverse_Proc_With_Parent): Likewise.
* contracts.adb (Fix_Parents): New subprogram.
(Restore_Original_Selected_Component): Enhanced to fix the
parent field of restored nodes.
(Inherit_Condition): Adding assertions to check the parent field
of inherited conditions and to ensure that the built inherited
condition has no reference to the formals of the parent
subprogram.
* sem_util.ads, sem_util.adb (Check_Parents): New subprogram.