From ae77b299e9717e3a76ac6b7be65145a50aa31ed2 Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Tue, 8 Dec 2020 12:14:08 -0500 Subject: [PATCH] [Ada] Assert failure on complex code with private type and discriminant gcc/ada/ * einfo.adb (Discriminant_Constraint): Refine assertion. --- gcc/ada/einfo.adb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gcc/ada/einfo.adb b/gcc/ada/einfo.adb index 8c401ca..471aea3 100644 --- a/gcc/ada/einfo.adb +++ b/gcc/ada/einfo.adb @@ -1120,7 +1120,9 @@ package body Einfo is function Discriminant_Constraint (Id : E) return L is begin - pragma Assert (Is_Composite_Type (Id) and then Has_Discriminants (Id)); + pragma Assert + (Is_Composite_Type (Id) + and then (Has_Discriminants (Id) or else Is_Constrained (Id))); return Elist21 (Id); end Discriminant_Constraint; -- 2.7.4