===================================================================
@@ -14495,7 +14495,6 @@
Assoc : constant Node_Id := Arg1;
Type_Id : constant Node_Id := Get_Pragma_Arg (Assoc);
Typ : Entity_Id;
- Discr : Entity_Id;
Tdef : Node_Id;
Clist : Node_Id;
Vpart : Node_Id;
@@ -14546,21 +14545,12 @@
-- Note: in previous versions of GNAT we used to check for limited
-- types and give an error, but in fact the standard does allow
-- Unchecked_Union on limited types, so this check was removed.
+ -- Similarly, GNAT used to require that all discriminants have
+ -- default values, but this is not mandated by the RM.
-- Proceed with basic error checks completed
else
- Discr := First_Discriminant (Typ);
- while Present (Discr) loop
- if No (Discriminant_Default_Value (Discr)) then
- Error_Msg_N
- ("unchecked union discriminant must have default value",
- Discr);
- end if;
-
- Next_Discriminant (Discr);
- end loop;
-
Tdef := Type_Definition (Declaration_Node (Typ));
Clist := Component_List (Tdef);