diff options
author | Ed Schonberg <schonberg@adacore.com> | 2005-11-15 14:58:51 +0100 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2005-11-15 14:58:51 +0100 |
commit | 57747aeceacde34a61431db5857e81a5dcfe7738 (patch) | |
tree | e32dc23d77d88fa699214dbbc0dd1d40ca6a0a07 | |
parent | 6aea4c392afdb943dfec1caab983518610f9d726 (diff) | |
download | gcc-57747aeceacde34a61431db5857e81a5dcfe7738.zip gcc-57747aeceacde34a61431db5857e81a5dcfe7738.tar.gz gcc-57747aeceacde34a61431db5857e81a5dcfe7738.tar.bz2 |
freeze.adb (Freeze_Entity): For an access formal that is an access to subprogram...
2005-11-14 Ed Schonberg <schonberg@adacore.com>
* freeze.adb (Freeze_Entity): For an access formal that is an access
to subprogram, freeze the anonymous subprogram type at the same time,
to prevent later freezing in the wrong scope, such as the enclosing
subprogram body.
(Freeze_Entity): Freeze the equivalent_type of an access_to_protected_
subprogram whenever available.
From-SVN: r106979
-rw-r--r-- | gcc/ada/freeze.adb | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/gcc/ada/freeze.adb b/gcc/ada/freeze.adb index 31f5bb1..6252fe8 100644 --- a/gcc/ada/freeze.adb +++ b/gcc/ada/freeze.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1992-2005 Free Software Foundation, Inc. -- +-- Copyright (C) 1992-2005, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -2257,6 +2257,9 @@ package body Freeze is Error_Msg_N ("(Ada 2005): invalid use of unconstrained tagged" & " incomplete type", E); + + elsif Ekind (F_Type) = E_Subprogram_Type then + Freeze_And_Append (F_Type, Loc, Result); end if; end if; @@ -3001,7 +3004,7 @@ package body Freeze is end if; -- For access to a protected subprogram, freeze the equivalent - -- type (however this is not set if we are not generating code) + -- type (however this is not set if we are not generating code -- or if this is an anonymous type used just for resolution). elsif Ekind (E) = E_Access_Protected_Subprogram_Type then @@ -3031,9 +3034,7 @@ package body Freeze is end if; end; - if Operating_Mode = Generate_Code - and then Present (Equivalent_Type (E)) - then + if Present (Equivalent_Type (E)) then Freeze_And_Append (Equivalent_Type (E), Loc, Result); end if; end if; |