+2017-09-06 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_attr.adb (Analyze_Attribute, case 'Loop_Entry): Handle
+ properly an attribute reference 'Loop_Entry that appears in the
+ list of indices of an indexed expression, to prevent an infinite
+ loop in the compiler.
+
+2017-09-06 Bob Duff <duff@adacore.com>
+
+ * s-fileio.adb (Name): Do not raise Use_Error for temp files.
+
+2017-09-06 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch4.adb (Analyze_Set_Membership): If an alternative
+ in a set membership is an overloaded enumeration literal, and
+ the type of the alternative is resolved from a previous one,
+ replace the entity of the alternative as well as the type,
+ to prevent inconsistencies between the entity and the type.
+
2017-09-06 Eric Botcazou <ebotcazou@adacore.com>
* ali.ads (ALIs_Record): Add No_Component_Reordering component.
begin
if File = null then
raise Status_Error with "Name: file not open";
- elsif File.Is_Temporary_File then
- raise Use_Error with "Name: temporary file has no name";
else
return File.Name.all (1 .. File.Name'Length - 1);
end if;
-- When the attribute is part of an indexed component, find the first
-- expression as it will determine the semantics of 'Loop_Entry.
- if Nkind (Context) = N_Indexed_Component then
+ -- If the attribute is itself an index in an indexed component, i.e.
+ -- a member of a list, the context itself is not relevant (the code
+ -- below would lead to an infinite loop) and the attribute applies
+ -- to the enclosing loop.
+
+ if Nkind (Context) = N_Indexed_Component
+ and then not Is_List_Member (N)
+ then
E1 := First (Expressions (Context));
E2 := Next (E1);
-- for all of them.
Set_Etype (Alt, It.Typ);
+
+ -- If the alternative is an enumeration literal, use
+ -- the one for this interpretation.
+
+ if Is_Entity_Name (Alt) then
+ Set_Entity (Alt, It.Nam);
+ end if;
+
Get_Next_Interp (Index, It);
if No (It.Typ) then
Set_Is_Overloaded (Alt, False);
Common_Type := Etype (Alt);
+
end if;
Candidate_Interps := Alt;