(Sy (Subtype_Mark, Node_Id, Default_Empty),
Sy (Expression, Node_Id, Default_Empty),
Sm (Kill_Range_Check, Flag),
- Sm (No_Truncation, Flag)),
- Nmake_Assert => "True or else Nkind (Expression) /= N_Unchecked_Type_Conversion");
--- Nmake_Assert => "Nkind (Expression) /= N_Unchecked_Type_Conversion");
- -- Assert that we don't have unchecked conversions of unchecked
- -- conversions; if Expression might be an unchecked conversion,
- -- then Tbuild.Unchecked_Convert_To should be used.
+ Sm (No_Truncation, Flag)));
Cc (N_Subtype_Indication, N_Has_Etype,
(Sy (Subtype_Mark, Node_Id, Default_Empty),
-- conversion of an unchecked conversion. Extra unchecked conversions
-- make the .dg output less readable. We can't do this in cases
-- involving bitfields, because the sizes might not match. The
- -- Is_Composite_Type checks avoid such cases.
+ -- "not Is_Scalar_Type" checks avoid such cases.
elsif Nkind (Expr) = N_Unchecked_Type_Conversion
- and then Is_Composite_Type (Etype (Expr))
- and then Is_Composite_Type (Typ)
+ and then not Is_Scalar_Type (Etype (Expr))
+ and then not Is_Scalar_Type (Typ)
then
Set_Subtype_Mark (Expr, New_Occurrence_Of (Typ, Loc));
Result := Relocate_Node (Expr);