[COMMITTED] ada: Fix predicate failure that occurred in a test case

Message ID 20231128093809.2970405-1-poulhies@adacore.com
State Committed
Commit 834f2973606c63b4cd9e27e3bf24f01ee1347568
Headers
Series [COMMITTED] ada: Fix predicate failure that occurred in a test case |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gcc_build--master-aarch64 warning Patch is already merged
linaro-tcwg-bot/tcwg_gcc_build--master-arm warning Patch is already merged

Commit Message

Marc Poulhiès Nov. 28, 2023, 9:38 a.m. UTC
  From: Tucker Taft <taft@adacore.com>

The CodePeer test case illustrating a problem where a "high"
precondition failure was expected, died in the GNAT FE on
input_reading.adb.  The problem was in Check_SCIL, where
it didn't properly handle a discriminant_specification.

gcc/ada/

	* sem_scil.adb: Handle discriminant specification.

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

---
 gcc/ada/sem_scil.adb | 1 +
 1 file changed, 1 insertion(+)
  

Patch

diff --git a/gcc/ada/sem_scil.adb b/gcc/ada/sem_scil.adb
index da8fab69a97..d7679d8b50f 100644
--- a/gcc/ada/sem_scil.adb
+++ b/gcc/ada/sem_scil.adb
@@ -91,6 +91,7 @@  package body Sem_SCIL is
             elsif Nkind (Ctrl_Tag) in N_Object_Renaming_Declaration
                                     | N_Object_Declaration
                                     | N_Parameter_Specification
+                                    | N_Discriminant_Specification
             then
                Ctrl_Typ := Etype (Defining_Identifier (Ctrl_Tag));