+2017-09-08 Gary Dismukes <dismukes@adacore.com>
+
+ * par-ch4.adb: Reformatting of an error message.
+
+2017-09-08 Javier Miranda <miranda@adacore.com>
+
+ * sem_ch3.adb (Resolve_Name): Under ASIS mode analyze overloaded
+ identifiers to ensure their correct decoration of names on
+ aspect expressions.
+
+2017-09-08 Yannick Moy <moy@adacore.com>
+
+ * exp_attr.adb (Expand_Loop_Entry_Attribute): Do
+ not skip a loop coming from source which is rewritten into a loop.
+
+2017-09-08 Ed Schonberg <schonberg@adacore.com>
+
+ * freeze.adb (Wrap_Imported_Subprogram): Indicate that the
+ wrapper has convention Ada, to prevent spurious warnings on
+ unconstrained array parameters.
+
+2017-09-08 Eric Botcazou <ebotcazou@adacore.com>
+
+ * sem_prag.adb (Check_Variant): Use First_Non_Pragma/Next_Non_Pragma.
+ (Analyze_Pragma) <Pragma_Unchecked_Union>: Likewise.
+
+2017-09-08 Eric Botcazou <ebotcazou@adacore.com>
+
+ * sem_ch6.adb (Freeze_Expr_Types): Rename Spec_Id into Def_Id.
+
2017-09-08 Arnaud Charlet <charlet@adacore.com>
* exp_intr.adb (Append_Entity_Name): Move to ...
Loop_Stmt := N;
while Present (Loop_Stmt) loop
if Nkind (Loop_Stmt) = N_Loop_Statement
- and then Comes_From_Source (Loop_Stmt)
+ and then Nkind (Original_Node (Loop_Stmt)) = N_Loop_Statement
+ and then Comes_From_Source (Original_Node (Loop_Stmt))
then
exit;
end if;
Prag := Copy_Import_Pragma;
- -- Fix up spec to be not imported any more
+ -- Fix up spec so it is no longer imported and has convention Ada
Set_Has_Completion (E, False);
Set_Import_Pragma (E, Empty);
Set_Interface_Name (E, Empty);
Set_Is_Imported (E, False);
+ Set_Convention (E, Convention_Ada);
-- Grab the subprogram declaration and specification
Set_Expression (Assoc_Node, P_Expression);
if Ada_Version < Ada_2020 then
- Error_Msg_SC ("Iterated component is an Ada 2020 extension");
+ Error_Msg_SC ("iterated component is an Ada 2020 extension");
Error_Msg_SC ("\compile with -gnatX");
end if;
elsif Nkind (N) = N_Identifier and then Chars (N) /= Chars (E) then
Find_Direct_Name (N);
- if not ASIS_Mode then
+ -- In ASIS mode we must analyze overloaded identifiers to ensure
+ -- their correct decoration because expansion is disabled (and
+ -- the expansion of freeze nodes takes care of resolving aspect
+ -- expressions).
+
+ if ASIS_Mode then
+ if Is_Overloaded (N) then
+ Analyze (Parent (N));
+ end if;
+ else
Set_Entity (N, Empty);
end if;
LocX : constant Source_Ptr := Sloc (Expr);
Spec : constant Node_Id := Specification (N);
- procedure Freeze_Expr_Types (Spec_Id : Entity_Id);
- -- N is an expression function that is a completion and Spec_Id its
+ procedure Freeze_Expr_Types (Def_Id : Entity_Id);
+ -- N is an expression function that is a completion and Def_Id its
-- defining entity. Freeze before N all the types referenced by the
-- expression of the function.
-- Freeze_Expr_Types --
-----------------------
- procedure Freeze_Expr_Types (Spec_Id : Entity_Id) is
+ procedure Freeze_Expr_Types (Def_Id : Entity_Id) is
function Cloned_Expression return Node_Id;
-- Build a duplicate of the expression of the return statement that
-- has no defining entities shared with the original expression.
-- Skip Itypes created by the preanalysis
if Is_Itype (Typ)
- and then Scope_Within_Or_Same (Scope (Typ), Spec_Id)
+ and then Scope_Within_Or_Same (Scope (Typ), Def_Id)
then
return;
end if;
-- Local variables
- Saved_First_Entity : constant Entity_Id := First_Entity (Spec_Id);
- Saved_Last_Entity : constant Entity_Id := Last_Entity (Spec_Id);
+ Saved_First_Entity : constant Entity_Id := First_Entity (Def_Id);
+ Saved_Last_Entity : constant Entity_Id := Last_Entity (Def_Id);
Dup_Expr : constant Node_Id := Cloned_Expression;
-- Start of processing for Freeze_Expr_Types
-- spurious errors on Ghost entities (since the expression is not
-- fully analyzed).
- Push_Scope (Spec_Id);
- Install_Formals (Spec_Id);
+ Push_Scope (Def_Id);
+ Install_Formals (Def_Id);
Ignore_Errors_Enable := Ignore_Errors_Enable + 1;
- Preanalyze_Spec_Expression (Dup_Expr, Etype (Spec_Id));
+ Preanalyze_Spec_Expression (Dup_Expr, Etype (Def_Id));
Ignore_Errors_Enable := Ignore_Errors_Enable - 1;
End_Scope;
- -- Restore certain attributes of Spec_Id since the preanalysis may
+ -- Restore certain attributes of Def_Id since the preanalysis may
-- have introduced itypes to this scope, thus modifying attributes
-- First_Entity and Last_Entity.
- Set_First_Entity (Spec_Id, Saved_First_Entity);
- Set_Last_Entity (Spec_Id, Saved_Last_Entity);
+ Set_First_Entity (Def_Id, Saved_First_Entity);
+ Set_Last_Entity (Def_Id, Saved_Last_Entity);
- if Present (Last_Entity (Spec_Id)) then
- Set_Next_Entity (Last_Entity (Spec_Id), Empty);
+ if Present (Last_Entity (Def_Id)) then
+ Set_Next_Entity (Last_Entity (Def_Id), Empty);
end if;
-- Freeze all types referenced in the expression
Comp : Node_Id;
begin
- Comp := First (Component_Items (Clist));
+ Comp := First_Non_Pragma (Component_Items (Clist));
while Present (Comp) loop
Check_Component (Comp, UU_Typ, In_Variant_Part => True);
- Next (Comp);
+ Next_Non_Pragma (Comp);
end loop;
end Check_Variant;
-- Check components
- Comp := First (Component_Items (Clist));
+ Comp := First_Non_Pragma (Component_Items (Clist));
while Present (Comp) loop
Check_Component (Comp, Typ);
- Next (Comp);
+ Next_Non_Pragma (Comp);
end loop;
-- Check variant part
Vpart := Variant_Part (Clist);
- Variant := First (Variants (Vpart));
+ Variant := First_Non_Pragma (Variants (Vpart));
while Present (Variant) loop
Check_Variant (Variant, Typ);
- Next (Variant);
+ Next_Non_Pragma (Variant);
end loop;
end if;
return;
elsif Nkind (Parent (N)) in N_Op
+ and then Present (Etype (Parent (N)))
and then Is_Fixed_Point_Type (Etype (Parent (N)))
and then Etype (N) = Universal_Real
and then Comes_From_Source (N)