+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
-- 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 :=
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
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))
-- 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
-- | 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.
---------------------------------------------