diff options
author | Arnaud Charlet <charlet@gcc.gnu.org> | 2011-08-29 12:44:14 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2011-08-29 12:44:14 +0200 |
commit | 646e2823137ee4f66ce92a6cf9947e308526de00 (patch) | |
tree | 1a0e7117535e8dcb9ba10bf3e740ec4930054e94 /gcc | |
parent | 5d59eef2697a46611385b025252447b6117578b6 (diff) | |
download | gcc-646e2823137ee4f66ce92a6cf9947e308526de00.zip gcc-646e2823137ee4f66ce92a6cf9947e308526de00.tar.gz gcc-646e2823137ee4f66ce92a6cf9947e308526de00.tar.bz2 |
[multiple changes]
2011-08-29 Thomas Quinot <quinot@adacore.com>
* sinfo.ads, sem_ch7.adb: Minor reformatting.
2011-08-29 Bob Duff <duff@adacore.com>
* sem_ch4.adb (Analyze_Allocator): Check No_Nested_Finalization
restriction on allocators, as required by AI05-0013-1.
* restrict.ads: Minor comment fix.
From-SVN: r178198
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/ChangeLog | 10 | ||||
-rw-r--r-- | gcc/ada/restrict.ads | 2 | ||||
-rw-r--r-- | gcc/ada/sem_ch4.adb | 10 | ||||
-rw-r--r-- | gcc/ada/sem_ch7.adb | 3 | ||||
-rw-r--r-- | gcc/ada/sinfo.ads | 16 |
5 files changed, 31 insertions, 10 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 38c1605..9a8e2dc 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,13 @@ +2011-08-29 Thomas Quinot <quinot@adacore.com> + + * sinfo.ads, sem_ch7.adb: Minor reformatting. + +2011-08-29 Bob Duff <duff@adacore.com> + + * sem_ch4.adb (Analyze_Allocator): Check No_Nested_Finalization + restriction on allocators, as required by AI05-0013-1. + * restrict.ads: Minor comment fix. + 2011-08-29 Tristan Gingold <gingold@adacore.com> * a-exexpr.adb, a-except-2005.ads (Jmpbuf_Address): Move to a-exexpr.adb diff --git a/gcc/ada/restrict.ads b/gcc/ada/restrict.ads index f022bce..a9b0c06 100644 --- a/gcc/ada/restrict.ads +++ b/gcc/ada/restrict.ads @@ -39,7 +39,7 @@ package Restrict is -- consistency, restrictions found in any with'ed units, parent specs -- etc., since we may as well check as much as we can at compile time. -- These variables should not be referenced directly by clients. Instead - -- use Check_Restrictions to record a violation of a restriction, and + -- use Check_Restriction to record a violation of a restriction, and -- Restriction_Active to test if a given restriction is active. Restrictions_Loc : array (All_Restrictions) of Source_Ptr := diff --git a/gcc/ada/sem_ch4.adb b/gcc/ada/sem_ch4.adb index 3696bbb..09d5b68 100644 --- a/gcc/ada/sem_ch4.adb +++ b/gcc/ada/sem_ch4.adb @@ -702,6 +702,16 @@ package body Sem_Ch4 is Check_Restriction (No_Task_Allocators, N); end if; + -- AI05-0013-1: No_Nested_Finalization forbids allocators if the access + -- type is nested, and the designated type needs finalization. The rule + -- is conservative in that class-wide types need finalization. + + if Needs_Finalization (Designated_Type (Acc_Type)) + and then not Is_Library_Level_Entity (Acc_Type) + then + Check_Restriction (No_Nested_Finalization, N); + end if; + -- Check that an allocator of a nested access type doesn't create a -- protected object when restriction No_Local_Protected_Objects applies. -- We don't have an equivalent to Has_Task for protected types, so only diff --git a/gcc/ada/sem_ch7.adb b/gcc/ada/sem_ch7.adb index 471d0f8..8cf1170 100644 --- a/gcc/ada/sem_ch7.adb +++ b/gcc/ada/sem_ch7.adb @@ -1195,7 +1195,8 @@ package body Sem_Ch7 is while Present (E) loop -- Check on incomplete types - -- AI05-213 : a formal incomplete type has no completion. + + -- AI05-0213: a formal incomplete type has no completion if Ekind (E) = E_Incomplete_Type and then No (Full_View (E)) diff --git a/gcc/ada/sinfo.ads b/gcc/ada/sinfo.ads index 744d7cc..87b0186 100644 --- a/gcc/ada/sinfo.ads +++ b/gcc/ada/sinfo.ads @@ -943,11 +943,11 @@ package Sinfo is -- there is no requirement that these match, and there are obscure cases -- of generated code where they do not match. - -- Note: Aspect specifications, introduced in Ada2012, require additional - -- links between identifiers and various attributes. These attributes - -- can be of arbitrary types, and the entity field of identifiers that - -- denote aspects must be used to store arbitrary expressions for later - -- semantic checks. See section on Aspect specifications for details. + -- Note: Ada 2012 aspect specifications require additional links between + -- identifiers and various attributes. These attributes can be of + -- arbitrary types, and the entity field of identifiers that denote + -- aspects must be used to store arbitrary expressions for later semantic + -- checks. See section on aspect specifications for details. -- Entity_Or_Associated_Node (Node4-Sem) -- A synonym for both Entity and Associated_Node. Used by convention in @@ -6237,9 +6237,9 @@ package Sinfo is -- | FORMAL_INTERFACE_TYPE_DEFINITION -- | FORMAL_INCOMPLETE_TYPE_DEFINITION - -- The Ada2012 syntax introduces two new non-terminals; - -- Formal_[Complete_| Incomplete_] Type_Declaration just to introduce - -- the later category. Here we introduce an incomplete type definition + -- The Ada 2012 syntax introduces two new non-terminals: + -- Formal_{Complete,Incomplete}_Type_Declaration just to introduce + -- the latter category. Here we introduce an incomplete type definition -- in order to preserve as much as possible the existing structure. --------------------------------------------- |