diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2017-04-25 10:07:38 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2017-04-25 10:07:38 +0200 |
commit | a187206c1450fc02d7a466b372c073b67f41c26b (patch) | |
tree | f8c6c93a6bf4164317376630f72b4e12aef4e5d1 /gcc/ada/sem_disp.adb | |
parent | 15fc8cb7ee426fe6730b742a7fecf05ba0082d87 (diff) | |
download | gcc-a187206c1450fc02d7a466b372c073b67f41c26b.zip gcc-a187206c1450fc02d7a466b372c073b67f41c26b.tar.gz gcc-a187206c1450fc02d7a466b372c073b67f41c26b.tar.bz2 |
[multiple changes]
2017-04-25 Tristan Gingold <gingold@adacore.com>
* s-mmap.ads (Data): Add pragma Inline.
2017-04-25 Hristian Kirtchev <kirtchev@adacore.com>
* checks.adb (Insert_Valid_Check): Do not use
a renaming to alias a volatile name because this will lead to
multiple evaluations of the volatile name. Use a constant to
capture the value instead.
2017-04-25 Doug Rupp <rupp@adacore.com>
* init.c [VxWorks Section]: Disable sigtramp for ppc64-vx7.
2017-04-25 Ed Schonberg <schonberg@adacore.com>
* exp_util.adb, exp_util.ads (Build_Class_Wide_Expression):
Add out parameter to indicate to caller that a wrapper must
be constructed for an inherited primitive whose inherited
pre/postcondition has called to overridden primitives.
* freeze.adb (Check_Inherited_Conditions): Build wrapper body
for inherited primitive that requires it.
* sem_disp.adb (Check_Dispatching_Operation): Such wrappers are
legal primitive operations and belong to the list of bodies
generated after the freeze point of a type.
* sem_prag.adb (Build_Pragma_Check_Equivalent): Use new signature
of Build_Class_Wide_Expression.
* sem_util.adb, sem_util.ads (Build_Overriding_Spec): New procedure
to construct the specification of the wrapper subprogram created
for an inherited operation.
From-SVN: r247140
Diffstat (limited to 'gcc/ada/sem_disp.adb')
-rw-r--r-- | gcc/ada/sem_disp.adb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/gcc/ada/sem_disp.adb b/gcc/ada/sem_disp.adb index ef1a20b..73bc8b6 100644 --- a/gcc/ada/sem_disp.adb +++ b/gcc/ada/sem_disp.adb @@ -1090,6 +1090,11 @@ package body Sem_Disp is -- 3. Subprograms associated with stream attributes (built by -- New_Stream_Subprogram) + -- 4. Wrapper built for inherited operations with inherited class- + -- wide conditions, where the conditions include calls to other + -- overridden primitives. The wrappers include checks on these + -- modified conditions. (AI12-113). + if Present (Old_Subp) and then Present (Overridden_Operation (Subp)) and then Is_Dispatching_Operation (Old_Subp) @@ -1098,14 +1103,18 @@ package body Sem_Disp is ((Ekind (Subp) = E_Function and then Is_Dispatching_Operation (Old_Subp) and then Is_Null_Extension (Base_Type (Etype (Subp)))) + or else (Ekind (Subp) = E_Procedure and then Is_Dispatching_Operation (Old_Subp) and then Present (Alias (Old_Subp)) and then Is_Null_Interface_Primitive (Ultimate_Alias (Old_Subp))) + or else Get_TSS_Name (Subp) = TSS_Stream_Read - or else Get_TSS_Name (Subp) = TSS_Stream_Write); + or else Get_TSS_Name (Subp) = TSS_Stream_Write + + or else Present (Contract (Overridden_Operation (Subp)))); Check_Controlling_Formals (Tagged_Type, Subp); Override_Dispatching_Operation (Tagged_Type, Old_Subp, Subp); |