public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Ada] Fix implementation of utility for finding enclosing declaration
@ 2018-05-23 10:32 Pierre-Marie de Rodat
  0 siblings, 0 replies; only message in thread
From: Pierre-Marie de Rodat @ 2018-05-23 10:32 UTC (permalink / raw)
  To: gcc-patches; +Cc: Yannick Moy

[-- Attachment #1: Type: text/plain, Size: 403 bytes --]

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.

Tested on x86_64-pc-linux-gnu, committed on trunk

2018-05-23  Yannick Moy  <moy@adacore.com>

gcc/ada/

	* sem_util.adb (Enclosing_Declaration): Fix the case of a named number
	declaration, which was not taken into account.

[-- Attachment #2: patch.diff --]
[-- Type: text/x-diff, Size: 482 bytes --]

--- gcc/ada/sem_util.adb
+++ 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;


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2018-05-23 10:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-23 10:32 [Ada] Fix implementation of utility for finding enclosing declaration Pierre-Marie de Rodat

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).