diff options
author | Ed Schonberg <schonberg@adacore.com> | 2008-08-05 17:11:19 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2008-08-05 17:11:19 +0200 |
commit | 4fec4e7aba00bc1be7fddc051687127000052c22 (patch) | |
tree | 9dc919b60738effa2418cd9ae7bbd9e9c414df3f /gcc | |
parent | dc0e0d6001b1c13122c11a5404e36161a9b9bda5 (diff) | |
download | gcc-4fec4e7aba00bc1be7fddc051687127000052c22.zip gcc-4fec4e7aba00bc1be7fddc051687127000052c22.tar.gz gcc-4fec4e7aba00bc1be7fddc051687127000052c22.tar.bz2 |
2008-08-05 Ed Schonberg <schonberg@adacore.com>
* freeze.adb:
(Freeze_Entity): A deferred constant does not violate the restriction
No_Default_Initialization,
From-SVN: r138725
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/freeze.adb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/ada/freeze.adb b/gcc/ada/freeze.adb index dffcbaf..5a8f983 100644 --- a/gcc/ada/freeze.adb +++ b/gcc/ada/freeze.adb @@ -2664,8 +2664,15 @@ package body Freeze is -- The check doesn't apply to imported objects, which are not -- ever default initialized, and is why the check is deferred -- until freezing, at which point we know if Import applies. + -- Deferred constants are also exempted from this test because + -- their completion is explicit, or through an import pragma. - if Comes_From_Source (E) + if Ekind (E) = E_Constant + and then Present (Full_View (E)) + then + null; + + elsif Comes_From_Source (E) and then not Is_Imported (E) and then not Has_Init_Expression (Declaration_Node (E)) and then |