]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Fix predicate failure that occurred in a test case
authorTucker Taft <taft@adacore.com>
Sat, 4 Nov 2023 13:53:28 +0000 (13:53 +0000)
committerMarc Poulhiès <poulhies@adacore.com>
Tue, 28 Nov 2023 09:35:47 +0000 (10:35 +0100)
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.

gcc/ada/sem_scil.adb

index da8fab69a97ebbfa0c80be25e0aca901f2b0cd49..d7679d8b50f99313551af910534af1c76bfe088d 100644 (file)
@@ -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));