gcc/ada/
* sem_aux.adb: Add a with clause for Nlists.
(Nearest_Ancestor): Test for the case of concurrent
types (testing for both Is_Concurrent_Type and
Is_Concurrent_Record_Type), and return the first ancestor in the
Interfaces list if present (otherwise will return Empty if no
interfaces).
* sem_ch13.adb (Build_Predicate_Functions): Add a ??? comment
about missing handling for adding predicates when they can be
inherited from multiple progenitors.
with Atree; use Atree;
with Einfo; use Einfo;
+with Nlists; use Nlists;
with Snames; use Snames;
with Stand; use Stand;
with Uintp; use Uintp;
end if;
end;
+ -- If this is a concurrent declaration with a nonempty interface list,
+ -- get the first progenitor. Account for case of a record type created
+ -- for a concurrent type (which is the only case that seems to occur
+ -- in practice).
+
+ elsif Nkind (D) = N_Full_Type_Declaration
+ and then (Is_Concurrent_Type (Defining_Identifier (D))
+ or else Is_Concurrent_Record_Type (Defining_Identifier (D)))
+ and then Is_Non_Empty_List (Interface_List (Type_Definition (D)))
+ then
+ return Entity (First (Interface_List (Type_Definition (D))));
+
-- If derived type and private type, get the full view to find who we
-- are derived from.
-- Add predicates for ancestor if present. These must come before the
-- ones for the current type, as required by AI12-0071-1.
+ -- Looks like predicates aren't added for case of inheriting from
+ -- multiple progenitors???
+
declare
Atyp : Entity_Id;
begin