]> git.ipfire.org Git - thirdparty/gcc.git/commit
ada: Fix internal error on quantified expression with predicated type
authorEric Botcazou <ebotcazou@adacore.com>
Wed, 15 Feb 2023 14:52:00 +0000 (15:52 +0100)
committerEric Botcazou <ebotcazou@adacore.com>
Wed, 27 Sep 2023 08:16:25 +0000 (10:16 +0200)
commitdce277e3410c348d23dffe2403ddd5fac689e26c
treee6bd53b14720f191d4f897dc6ae9554de02fe4d0
parent29380ebc811730c82832dfa386b8dc8d3ad8bf69
ada: Fix internal error on quantified expression with predicated type

The problem is that the special function created by the compiler to check
the predicate does not inherit the public status of the type, because it
is generated as part of the freezing of the quantified expression, which
occurs from within a couple of intermediate internal scopes.

gcc/ada/

* sem_ch13.adb (Build_Predicate_Function_Declaration): Adjust the
commentary to the current implementation.
* sem_util.ads (Current_Scope_No_Loops): Move around.
(Current_Scope_No_Loops_No_Blocks): New declaration.
(Add_Block_Identifier): Fix formatting.
* sem_util.adb (Add_Block_Identifier): Likewise.
(Current_Scope_No_Loops_No_Blocks): New function.
(Set_Public_Status): Call Current_Scope_No_Loops_No_Blocks instead
of Current_Scope to get the current scope.
gcc/ada/sem_ch13.adb
gcc/ada/sem_util.adb
gcc/ada/sem_util.ads