public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-5016] [Ada] Guard against illegal items in Global but not Depends
@ 2021-11-09  9:45 Pierre-Marie de Rodat
  0 siblings, 0 replies; only message in thread
From: Pierre-Marie de Rodat @ 2021-11-09  9:45 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:9c8bb4d68240c2449c8ec9532f683cdad5bbbdbd

commit r12-5016-g9c8bb4d68240c2449c8ec9532f683cdad5bbbdbd
Author: Piotr Trojanek <trojanek@adacore.com>
Date:   Mon Oct 25 16:33:24 2021 +0200

    [Ada] Guard against illegal items in Global but not Depends
    
    gcc/ada/
    
            * sem_prag.adb (Check_Usage): Guard against calling Usage_Error
            with illegal Item_Id. The intention to do this was already
            described in the comment but not implemented.

Diff:
---
 gcc/ada/sem_prag.adb | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb
index 10ad82fd8a4..1c048145bb4 100644
--- a/gcc/ada/sem_prag.adb
+++ b/gcc/ada/sem_prag.adb
@@ -1684,7 +1684,15 @@ package body Sem_Prag is
                --  States and global objects are not used properly only when
                --  the subprogram is subject to pragma Global.
 
-               elsif Global_Seen then
+               elsif Global_Seen
+                 and then Ekind (Item_Id) in E_Abstract_State
+                                           | E_Constant
+                                           | E_Loop_Parameter
+                                           | E_Protected_Type
+                                           | E_Task_Type
+                                           | E_Variable
+                                           | Formal_Kind
+               then
                   Usage_Error (Item_Id);
                end if;
             end if;


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

only message in thread, other threads:[~2021-11-09  9:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-09  9:45 [gcc r12-5016] [Ada] Guard against illegal items in Global but not Depends 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).