[Ada] Spurious error on early call region of tagged type
authorHristian Kirtchev <kirtchev@adacore.com>
Mon, 21 May 2018 14:52:11 +0000 (14:52 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Mon, 21 May 2018 14:52:11 +0000 (14:52 +0000)
commit7a500fd767dd9f7afff999dd1d9c8bbb6dbef268
tree2c1e0db9a2c40a807091e17cfed381bea58ab551
parent516057d379930306bc240b7b2b4eedb2c9bb1aeb
[Ada] Spurious error on early call region of tagged type

This patch corrects the part of the access-before-elaboration mechanism which
ensures that the freeze node of a tagged type is within the early call region
of all its overriding bodies to ignore predefined primitives.

------------
-- Source --
------------

--  pack.ads

package Pack with SPARK_Mode is
   type Parent_Typ is tagged null record;
   procedure Prim (Obj : Parent_Typ);

   type Deriv_Typ is new Parent_Typ with private;
   overriding procedure Prim (Obj : Deriv_Typ);

private
   type Deriv_Typ is new Parent_Typ with null record;
end Pack;

-----------------
-- Compilation --
-----------------

$ gcc -c pack.ads

2018-05-21  Hristian Kirtchev  <kirtchev@adacore.com>

gcc/ada/

* exp_cg.adb: Remove with and use clause for Exp_Disp.
* exp_ch9.adb: Remove with and use clause for Exp_Disp.
* exp_disp.adb (Is_Predefined_Dispatching_Operation): Moved to Sem_Util.
(Is_Predefined_Interface_Primitive): Moved to Sem_Util.
(Is_Predefined_Internal_Operation): Moved to Sem_Util.
* exp_disp.ads (Is_Predefined_Dispatching_Operation): Moved to Sem_Util.
(Is_Predefined_Interface_Primitive): Moved to Sem_Util.
(Is_Predefined_Internal_Operation): Moved to Sem_Util.
* exp_dist.adb: Remove with and use clause for Exp_Disp.
* freeze.adb: Remove with and use clause for Exp_Disp.
* sem_cat.adb: Remove with and use clause for Exp_Disp.
* sem_ch6.adb: Remove with and use clause for Exp_Disp.
* sem_ch12.adb: Remove with and use clause for Exp_Disp.
* sem_elab.adb (Check_Overriding_Primitive): Do not process predefined
primitives.
* sem_util.adb: Remove with and use clause for Exp_Disp.
(Is_Predefined_Dispatching_Operation): Moved from Exp_Disp.
(Is_Predefined_Interface_Primitive): Moved from Exp_Disp.
(Is_Predefined_Internal_Operation): Moved from Exp_Disp.
* sem_util.ads (Is_Predefined_Dispatching_Operation): Moved from
Exp_Disp.
(Is_Predefined_Interface_Primitive): Moved from Exp_Disp.
(Is_Predefined_Internal_Operation): Moved from Exp_Disp.

From-SVN: r260467
13 files changed:
gcc/ada/ChangeLog
gcc/ada/exp_cg.adb
gcc/ada/exp_ch9.adb
gcc/ada/exp_disp.adb
gcc/ada/exp_disp.ads
gcc/ada/exp_dist.adb
gcc/ada/freeze.adb
gcc/ada/sem_cat.adb
gcc/ada/sem_ch12.adb
gcc/ada/sem_ch6.adb
gcc/ada/sem_elab.adb
gcc/ada/sem_util.adb
gcc/ada/sem_util.ads