]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Match assertion levels by name
authorViljar Indus <indus@adacore.com>
Tue, 2 Sep 2025 14:11:14 +0000 (17:11 +0300)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Mon, 15 Sep 2025 12:59:32 +0000 (14:59 +0200)
Since Assertion_Levels cannot be named after valid assertion names
we no longer need the policies to be matched by entity.

gcc/ada/ChangeLog:

* sem_prag.adb (Get_Applicable_Policy): Match assertion levels
by name.

gcc/ada/sem_prag.adb

index 172dc3d6f3ecfc2bf68cebe28fe6088ff0bd8458..b1fefa8a29729b1846d08610e978ae66b1d07e73 100644 (file)
@@ -34217,7 +34217,7 @@ package body Sem_Prag is
            or else P_Nam = Name_Assertion
            or else (P_Nam = Name_Statement_Assertions
                     and then Is_Statement_Assertion (Nam))
-           or else (Present (Level) and then Entity (P_Arg) = Level)
+           or else (Present (Level) and then P_Nam = Chars (Level))
          then
             return Chars (Get_Pragma_Arg (Last (Assocs)));
          end if;