]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Add assertion on expanded code in particular case
authorRonan Desplanques <desplanques@adacore.com>
Mon, 17 Mar 2025 16:18:26 +0000 (17:18 +0100)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Tue, 10 Jun 2025 07:32:01 +0000 (09:32 +0200)
This patch adds an assertion that checks that expanded code does not
contain erroneous access subtype definitions.

gcc/ada/ChangeLog:

* sem_ch3.adb (Process_Subtype): Add assertion.

gcc/ada/sem_ch3.adb

index 0c262aa40f36851b371a35a1077ef69cf7bbaccb..ca500bc1e15257db33167381b34cff0931fc8237 100644 (file)
@@ -22725,6 +22725,8 @@ package body Sem_Ch3 is
                      Error_Msg_N
                        ("constraint on class-wide type ignored??",
                         Constraint (S));
+                  else
+                     pragma Assert (False);
                   end if;
 
                   if Nkind (P) = N_Subtype_Declaration then