diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-07-30 14:34:38 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2014-07-30 14:34:38 +0000 |
commit | c10db69a240ee9e328f681ec8f7cf19957daaea5 (patch) | |
tree | 6ff105c888eb96db6135dc2dcd5bd6b1d8d5ed62 /gcc/ada/a-ciorse.ads | |
parent | a92b003e62dc136a8e9fd5ad12a969e6055ab0da (diff) | |
download | gcc-c10db69a240ee9e328f681ec8f7cf19957daaea5.tar.gz |
2014-07-30 Ed Schonberg <schonberg@adacore.com>
* freeze.adb (Check_Expression_Function): At the freeze point
of an expression function, verify that the expression in the
function does not contain references to any deferred constants
that have no completion yet.
(Freeze_Expression, Freeze_Before): call
Check_Expression_Function.
* a-ciorse.ads: Add Reference_Control_Type to detect tampering.
* a-ciorse.adb: Add Adjust and Finalize routines for
Reference_Control_Type. Use it in the construction of Reference
and Constant_Reference values.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@213287 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/a-ciorse.ads')
-rw-r--r-- | gcc/ada/a-ciorse.ads | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/gcc/ada/a-ciorse.ads b/gcc/ada/a-ciorse.ads index 0dba13e42ed..830f9886624 100644 --- a/gcc/ada/a-ciorse.ads +++ b/gcc/ada/a-ciorse.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 2004-2013, Free Software Foundation, Inc. -- +-- Copyright (C) 2004-2014, Free Software Foundation, Inc. -- -- -- -- This specification is derived from the Ada Reference Manual for use with -- -- GNAT. The copyright notice above, and the license provisions that follow -- @@ -293,8 +293,28 @@ package Ada.Containers.Indefinite_Ordered_Sets is Key : Key_Type) return Reference_Type; private - type Reference_Type - (Element : not null access Element_Type) is null record; + type Set_Access is access all Set; + for Set_Access'Storage_Size use 0; + + type Key_Access is access all Key_Type; + + type Reference_Control_Type is + new Ada.Finalization.Controlled with + record + Container : Set_Access; + Pos : Cursor; + Old_Key : Key_Access; + end record; + + overriding procedure Adjust (Control : in out Reference_Control_Type); + pragma Inline (Adjust); + + overriding procedure Finalize (Control : in out Reference_Control_Type); + pragma Inline (Finalize); + + type Reference_Type (Element : not null access Element_Type) is record + Control : Reference_Control_Type; + end record; use Ada.Streams; |