+2014-01-31 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch6.adb (Process_Formals): In Ada2012 mode, place
+ subprogram with an incomplete untagged formals on the list of
+ private dependents, to verify that the type is properly completed
+ in the private part.
+ * sem_attr.adb: Code clean up.
+
+2014-01-31 Robert Dewar <dewar@adacore.com>
+
+ * exp_ch6.adb: Minor reformatting.
+
+2014-01-31 Vincent Celier <celier@adacore.com>
+
+ * prj-attr.adb (First_Attribute_Of): Return Unknown_Attribute
+ when Pkg is unknown.
+
2014-01-31 Hristian Kirtchev <kirtchev@adacore.com>
* sem_res.adb (Resolve_Entity_Name): Comment
-- is done because the input type may lack aspect/pragma
-- predicate and simply inherit those from its ancestor.
- -- Note that predicate pragmas include all three cases of
- -- predicate aspects (Predicate, Dynamic_Predicate,
+ -- Note that predicate pragmas correspond to all three cases
+ -- of predicate aspects (Predicate, Dynamic_Predicate, and
-- Static_Predicate), so this routine checks for all three
-- cases.
then
null;
- -- Add the item
+ -- Otherwise, add the item
else
if No (List) then
end if;
-- For now we test whether E denotes a function or access-to-function
- -- type whose result subtype is inherently limited. Later this test may
- -- be revised to allow composite nonlimited types. Functions with a
- -- foreign convention or whose result type has a foreign convention
+ -- type whose result subtype is inherently limited. Later this test
+ -- may be revised to allow composite nonlimited types. Functions with
+ -- a foreign convention or whose result type has a foreign convention
-- never qualify.
if Ekind_In (E, E_Function, E_Generic_Function)
Function_Id : Entity_Id;
begin
- -- Return False when the expander is inactive, since awareness of
- -- build-in-place treatment is only relevant during expansion. Note that
- -- Is_Build_In_Place_Function, which is called as part of this function,
- -- is also conditioned this way, but we need to check here as well to
- -- avoid blowing up on processing protected calls when expansion is
- -- disabled (such as with -gnatc) since those would trip over the raise
- -- of Program_Error below.
+ -- Return False if the expander is currently inactive, since awareness
+ -- of build-in-place treatment is only relevant during expansion. Note
+ -- that Is_Build_In_Place_Function, which is called as part of this
+ -- function, is also conditioned this way, but we need to check here as
+ -- well to avoid blowing up on processing protected calls when expansion
+ -- is disabled (such as with -gnatc) since those would trip over the
+ -- raise of Program_Error below.
-- In SPARK mode, build-in-place calls are not expanded, so that we
-- may end up with a call that is neither resolved to an entity, nor
-- Handle CPP primitives found in derivations of CPP_Class types.
-- These primitives must have been inherited from some parent, and
-- there is no need to register them in the dispatch table because
- -- Build_Inherit_Prims takes care of the initialization of these
- -- slots.
+ -- Build_Inherit_Prims takes care of initializing these slots.
elsif Is_Imported (Subp)
and then (Convention (Subp) = Convention_CPP
if Is_Tagged_Type (Typ) then
null;
- elsif Nkind_In (Parent (Parent (N)),
- N_Accept_Statement,
- N_Entry_Body,
- N_Subprogram_Body)
+ elsif Nkind (Parent (N)) = N_Subprogram_Body
+ or else
+ Nkind_In (Parent (Parent (N)),
+ N_Accept_Statement,
+ N_Entry_Body)
then
Error_Msg_NE
("invalid use of untagged incomplete type&",
-- Ada 2012: tagged incomplete types are allowed as generic
-- formal types. They do not introduce dependencies and the
-- corresponding generic subprogram does not have a delayed
- -- freeze, because it does not need a freeze node.
-
- if Is_Tagged_Type (Formal_Type) then
+ -- freeze, because it does not need a freeze node. However,
+ -- it is still the case that untagged incomplete types cannot
+ -- be Taft-amendment types and must be completed in private
+ -- part, so the subprogram must appear in the list of private
+ -- dependents of the type.
+
+ if Is_Tagged_Type (Formal_Type)
+ or else Ada_Version >= Ada_2012
+ then
if Ekind (Scope (Current_Scope)) = E_Package
and then not From_Limited_With (Formal_Type)
and then not Is_Generic_Type (Formal_Type)