+2014-10-31 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_attr.adb (Analyze_Access_Attribute): Do not emit error
+ message if reference does not come from source, as in the case
+ for the controlling argument of a dispatching call. Error is
+ diagnosed when call is resolved.
+ * sem_ch4.adb (Complete_Object_Operation); Fix incorrect RM
+ reference in error message.
+ * sem_res.adb (Check_Prefixed_Call): ditto.
+
+2014-10-31 Yannick Moy <moy@adacore.com>
+
+ * sem_prag.adb (Process_Restrictions_Or_Restriction_Warnings): Do not
+ suppress checks when pragma Restrictions (No_Exception) is used in
+ CodePeer or GNATprove mode.
+
+2014-10-31 Yannick Moy <moy@adacore.com>
+
+ * gnat1drv.adb (Adjust_Global_Switches): Explicitly mark language
+ checks as not suppressed in GNATprove mode.
+
+2014-10-31 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_elab.adb (Check_Elab_Call): Nothing to check if call is
+ being pre-analyzed.
+ * sem_ch3.adb (Complete_Private_Subtype): If all rep items of full
+ view are those of the base, use rep_item chain of partial view,
+ which may include aspects.
+ * sem_cat.adb (Is_non_Remote_Access_Type): Use underlying type
+ of base type, to handle properly declared subtypes.
+
2014-10-31 Ed Schonberg <schonberg@adacore.com>
* sem_ch12.adb (Analyze_Generic_Package_Declaration): If there
-- happens anyway because this expansion is simply not done in the
-- SPARK version of the expander.
+ -- On the contrary, we need to enable explicitly all language checks,
+ -- as they may have been marked as suppressed by the use of switch
+ -- -gnatp
+
+ Suppress_Options.Suppress := (others => False);
+
-- Turn off dynamic elaboration checks: generates inconsistencies in
-- trees between specs compiled as part of a main unit or as part of
-- a with-clause.
if not Is_Aliased_View (P)
and then not In_Instance
and then not In_Inlined_Body
+ and then Comes_From_Source (N)
then
-- Here we have a non-aliased view. This is illegal unless we
-- have the case of Unrestricted_Access, where for now we allow
-- this (we will reject later if expected type is access to an
-- unconstrained array with a thin pointer).
+ -- No need for an error message on a generated access reference
+ -- for the controlling argument in a dispatching call: error will
+ -- be reported when resolving the call.
+
if Aname /= Name_Unrestricted_Access then
Error_Attr_P ("prefix of % attribute must be aliased");
Check_No_Implicit_Aliasing (P);
-------------------------------
function Is_Non_Remote_Access_Type (E : Entity_Id) return Boolean is
- U_E : constant Entity_Id := Underlying_Type (E);
+ U_E : constant Entity_Id := Underlying_Type (Base_Type (E));
+ -- Use full view of base type to handle subtypes properly.
+
begin
if No (U_E) then
Typ := First_Entity (Name_U);
while Present (Typ) and then Typ /= First_Priv_Ent loop
- U_Typ := Underlying_Type (Typ);
+ U_Typ := Underlying_Type (Base_Type (Typ));
if No (U_Typ) then
U_Typ := Typ;
Item := First_Rep_Item (Full);
-- If no existing rep items on full type, we can just link directly
- -- to the list of items on the private type.
+ -- to the list of items on the private type. Same if the rep items
+ -- are only those inherited from the base
- if No (Item) then
+ if No (Item)
+ or else Nkind (Item) /= N_Aspect_Specification
+ or else Entity (Item) = Full_Base
+ then
Set_First_Rep_Item (Full, First_Rep_Item (Priv));
-- Otherwise, search to the end of items currently linked to the full
if not Is_Aliased_View (Obj) then
Error_Msg_NE
("object in prefixed call to & must be aliased "
- & "(RM-2005 4.3.1 (13))", Prefix (First_Actual), Subprog);
+ & "(RM 4.1.3 (13 1/2))", Prefix (First_Actual), Subprog);
end if;
Analyze (First_Actual);
and then No (Enclosing_Generic_Body (N))
then
return;
+
+ -- Nothing to do if call is being pre-analyzed, as when within a
+ -- pre/postcondition, a predicate, or an invariant.
+
+ elsif In_Spec_Expression then
+ return;
end if;
-- Nothing to do if this is a call to a postcondition, which is always
-- Atomic_Synchronization is not a real check, so it is not
-- affected by this processing).
- if R_Id = No_Exceptions and then not Warn then
+ -- Ignore the effect of pragma Restrictions (No_Exceptions) on
+ -- run-time checks in CodePeer and GNATprove modes: we want to
+ -- generate checks for analysis purposes, as set respectively
+ -- by -gnatC and -gnatd.F
+
+ if not Warn
+ and then not (CodePeer_Mode or GNATprove_Mode)
+ and then R_Id = No_Exceptions
+ then
for J in Scope_Suppress.Suppress'Range loop
if J /= Atomic_Synchronization then
Scope_Suppress.Suppress (J) := True;
if not Is_Aliased_View (Act) then
Error_Msg_NE
("object in prefixed call to& must be aliased "
- & "(RM-2005 4.3.1 (13))",
+ & "(RM 4.1.3 (13 1/2))",
Prefix (Act), Nam);
end if;