]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[Ada] Fix ignored dynamic predicates specified through "predicate" aspect
authorGhjuvan Lacambre <lacambre@adacore.com>
Fri, 2 Jul 2021 14:09:27 +0000 (16:09 +0200)
committerPierre-Marie de Rodat <derodat@adacore.com>
Tue, 21 Sep 2021 15:24:58 +0000 (15:24 +0000)
gcc/ada/

* sem_eval.adb (Is_Static_Subtype): Take predicates created
through "predicate" pragma into account.

gcc/ada/sem_eval.adb

index 8817cea3d923ecb29175885251b9f9b7a05e25cd..da51caa30a124609f2c92f64f14d6a71091cb986 100644 (file)
@@ -5741,6 +5741,8 @@ package body Sem_Eval is
       elsif Has_Dynamic_Predicate_Aspect (Typ)
         or else (Is_Derived_Type (Typ)
                   and then Has_Aspect (Typ, Aspect_Dynamic_Predicate))
+        or else (Has_Aspect (Typ, Aspect_Predicate)
+                  and then not Has_Static_Predicate (Typ))
       then
          return False;