diff options
| author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-08-05 15:11:19 +0000 |
|---|---|---|
| committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-08-05 15:11:19 +0000 |
| commit | 02c9c2f399df6f06944639b7b217cea0063f92b6 (patch) | |
| tree | 9dc919b60738effa2418cd9ae7bbd9e9c414df3f | |
| parent | be58c9b08a3a5e70c96a84227f8bb606c7b69179 (diff) | |
| download | ppe42-gcc-02c9c2f399df6f06944639b7b217cea0063f92b6.tar.gz ppe42-gcc-02c9c2f399df6f06944639b7b217cea0063f92b6.zip | |
2008-08-05 Ed Schonberg <schonberg@adacore.com>
* freeze.adb:
(Freeze_Entity): A deferred constant does not violate the restriction
No_Default_Initialization,
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@138725 138bc75d-0d04-0410-961f-82ee72b054a4
| -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 dffcbaf3b40..5a8f98380a7 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 |

