aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/ChangeLog6
-rw-r--r--gcc/ada/sem_eval.adb9
2 files changed, 15 insertions, 0 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 6318f8c..7ffbe3a 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,9 @@
+2025-11-07 Eric Botcazou <ebotcazou@adacore.com>
+
+ PR ada/83188
+ * sem_eval.adb (Subtypes_Statically_Match): Deal with class-wide
+ subtypes whose class-wide types have discriminants.
+
2025-11-06 Eric Botcazou <ebotcazou@adacore.com>
PR ada/113352
diff --git a/gcc/ada/sem_eval.adb b/gcc/ada/sem_eval.adb
index f970932..7640149 100644
--- a/gcc/ada/sem_eval.adb
+++ b/gcc/ada/sem_eval.adb
@@ -6837,6 +6837,15 @@ package body Sem_Eval is
then
return True;
+ -- Handle class-wide subtypes, which never have discriminants, while
+ -- class-wide types may have them (but they are always unknown).
+
+ elsif Ekind (T2) = E_Class_Wide_Subtype and then Etype (T2) = T1 then
+ return True;
+
+ elsif Ekind (T1) = E_Class_Wide_Subtype and then Etype (T1) = T2 then
+ return True;
+
-- Because of view exchanges in multiple instantiations, conformance
-- checking might try to match a partial view of a type with no
-- discriminants with a full view that has defaulted discriminants.