@@ -2689,8 +2689,10 @@ package body Exp_Aggr is
Discr_Constr :=
First_Elmt (Stored_Constraint (Full_View (Base_Typ)));
+ -- Otherwise, no discriminant to process
+
else
- Discr_Constr := First_Elmt (Stored_Constraint (Typ));
+ Discr_Constr := No_Elmt;
end if;
while Present (Discr) and then Present (Discr_Constr) loop
new file mode 100644
@@ -0,0 +1,17 @@
+-- { dg-do compile }
+
+procedure Discr57 is
+
+ type T1(Scalar : Boolean) is abstract tagged null record;
+
+ subtype S1 is T1 (Scalar => False);
+
+ type T2(Lower_Bound : Natural) is new
+ S1 with null record;
+
+ Obj : constant T2 :=
+ (Lower_Bound => 123);
+
+begin
+ null;
+end Discr57;