diff options
author | Ed Schonberg <schonberg@adacore.com> | 2020-04-30 15:19:16 -0400 |
---|---|---|
committer | Giuliano Belinassi <giuliano.belinassi@usp.br> | 2020-08-17 13:14:09 -0300 |
commit | a2b595369128e24c26b812cf29f1a906f1666715 (patch) | |
tree | 6df34c03d25896439fa6b9091ca5203cf522220b /gcc | |
parent | 23832bc7f13e9a430418a9096c768420c71e842c (diff) | |
download | gcc-a2b595369128e24c26b812cf29f1a906f1666715.zip gcc-a2b595369128e24c26b812cf29f1a906f1666715.tar.gz gcc-a2b595369128e24c26b812cf29f1a906f1666715.tar.bz2 |
[Ada] Spurious error on private type in ghost expression function
2020-06-19 Ed Schonberg <schonberg@adacore.com>
gcc/ada/
* sem_ch6.adb (Analyze_Expression_Function): Do not indicate
that the function has a completion if it appears within a Ghost
generic package.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/sem_ch6.adb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb index 59cbccd..69e21bb 100644 --- a/gcc/ada/sem_ch6.adb +++ b/gcc/ada/sem_ch6.adb @@ -499,9 +499,14 @@ package body Sem_Ch6 is -- Within a generic preanalyze the original expression for name -- capture. The body is also generated but plays no role in -- this because it is not part of the original source. + -- If this is an ignored Ghost entity, analysis of the generated + -- body is needed to hide external references (as is done in + -- Analyze_Subprogram_Body) after which the the subprogram profile + -- can be frozen, which is needed to expand calls to such an ignored + -- Ghost subprogram. if Inside_A_Generic then - Set_Has_Completion (Def_Id); + Set_Has_Completion (Def_Id, not Is_Ignored_Ghost_Entity (Def_Id)); Push_Scope (Def_Id); Install_Formals (Def_Id); Preanalyze_Spec_Expression (Expr, Etype (Def_Id)); |