From: Ronan Desplanques <desplanq...@adacore.com>

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.

Tested on x86_64-pc-linux-gnu, committed on master.

---
 gcc/ada/sem_ch3.adb | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb
index 0c262aa40f3..ca500bc1e15 100644
--- a/gcc/ada/sem_ch3.adb
+++ b/gcc/ada/sem_ch3.adb
@@ -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
-- 
2.43.0

Reply via email to