diff options
author | Ed Schonberg <schonberg@adacore.com> | 2008-08-06 10:52:36 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2008-08-06 10:52:36 +0200 |
commit | c9b9957118ebcb122ffeef1b73184e5b8736b2ef (patch) | |
tree | e7ae26231101b088574781275580ad7b98a48840 /gcc | |
parent | 2a26a7ec2fd1218218fe187e9bb758e889e18f04 (diff) | |
download | gcc-c9b9957118ebcb122ffeef1b73184e5b8736b2ef.zip gcc-c9b9957118ebcb122ffeef1b73184e5b8736b2ef.tar.gz gcc-c9b9957118ebcb122ffeef1b73184e5b8736b2ef.tar.bz2 |
sem_res.adb (Resolve_Call): Use base type to determine whether a dereference is needed because a subtype of...
2008-08-06 Ed Schonberg <schonberg@adacore.com>
* sem_res.adb (Resolve_Call): Use base type to determine whether a
dereference is needed because a subtype of an access_to_subprogram is
simply an access-subtype
From-SVN: r138779
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/sem_res.adb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb index b0d46ae..d2e74c2 100644 --- a/gcc/ada/sem_res.adb +++ b/gcc/ada/sem_res.adb @@ -4696,14 +4696,15 @@ package body Sem_Res is end loop; end if; - if Ekind (Etype (Nam)) = E_Access_Subprogram_Type - and then Ekind (Typ) /= E_Access_Subprogram_Type + if Is_Access_Subprogram_Type (Base_Type (Etype (Nam))) + and then not Is_Access_Subprogram_Type (Base_Type (Typ)) and then Nkind (Subp) /= N_Explicit_Dereference and then Present (Parameter_Associations (N)) then -- The prefix is a parameterless function call that returns an -- access to subprogram. If parameters are present in the current - -- call add an explicit dereference. + -- call add an explicit dereference. We use the base type here + -- because within an instance these may be subtypes. -- The dereference is added either in Analyze_Call or here. Should -- be consolidated ??? |