From: Yannick Moy Date: Wed, 23 May 2018 10:22:57 +0000 (+0000) Subject: [Ada] Fix implementation of utility for finding enclosing declaration X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=fd82aeff6d4338a3b9f280e423ec5236ae0fc510;p=gcc.git [Ada] Fix implementation of utility for finding enclosing declaration This utility is used in GNATprove to find when a node is inside a named number declaration, and this case was not properly handled. Now fixed. There is no impact on compilation. 2018-05-23 Yannick Moy gcc/ada/ * sem_util.adb (Enclosing_Declaration): Fix the case of a named number declaration, which was not taken into account. From-SVN: r260586 --- diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index f24eda6a112..b3096160b56 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,8 @@ +2018-05-23 Yannick Moy + + * sem_util.adb (Enclosing_Declaration): Fix the case of a named number + declaration, which was not taken into account. + 2018-05-23 Hristian Kirtchev * debug.adb: Switch -gnatd_s is now used to stop elaboration checks on diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb index 875b9eb6458..2d516ffd553 100644 --- a/gcc/ada/sem_util.adb +++ b/gcc/ada/sem_util.adb @@ -6635,7 +6635,9 @@ package body Sem_Util is while Present (Decl) and then not (Nkind (Decl) in N_Declaration or else - Nkind (Decl) in N_Later_Decl_Item) + Nkind (Decl) in N_Later_Decl_Item + or else + Nkind (Decl) = N_Number_Declaration) loop Decl := Parent (Decl); end loop;