public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-1471] [Ada] Fix detection of access-to-variable types
@ 2021-06-15 10:22 Pierre-Marie de Rodat
  0 siblings, 0 replies; only message in thread
From: Pierre-Marie de Rodat @ 2021-06-15 10:22 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:903655af70232eee31e5d83c59a45fa4d9e9ab00

commit r12-1471-g903655af70232eee31e5d83c59a45fa4d9e9ab00
Author: Piotr Trojanek <trojanek@adacore.com>
Date:   Fri Feb 12 00:11:03 2021 +0100

    [Ada] Fix detection of access-to-variable types
    
    gcc/ada/
    
            * sem_prag.adb: Fix typos in comments related to access types.
            * sem_util.adb (Is_Access_Variable): Stronger condition.

Diff:
---
 gcc/ada/sem_prag.adb | 4 ++--
 gcc/ada/sem_util.adb | 5 +++--
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb
index 67b2f25edf5..d52ad5c6bfe 100644
--- a/gcc/ada/sem_prag.adb
+++ b/gcc/ada/sem_prag.adb
@@ -2464,7 +2464,7 @@ package body Sem_Prag is
 
                   if Global_Mode in Name_In_Out | Name_Output then
 
-                     --  Constant of a access-to-variable type is a read-write
+                     --  Constant of an access-to-variable type is a read-write
                      --  item in procedures, generic procedures, protected
                      --  entries and tasks.
 
@@ -13431,7 +13431,7 @@ package body Sem_Prag is
                     Arg1);
                end if;
 
-            --  Only other possibility is Access-to-class-wide type
+            --  Only other possibility is access-to-class-wide type
 
             elsif Is_Access_Type (Nm)
               and then Is_Class_Wide_Type (Designated_Type (Nm))
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb
index 20246823d88..c9a2c9fb228 100644
--- a/gcc/ada/sem_util.adb
+++ b/gcc/ada/sem_util.adb
@@ -15386,8 +15386,9 @@ package body Sem_Util is
 
    function Is_Access_Variable (E : Entity_Id) return Boolean is
    begin
-      return Is_Access_Object_Type (E)
-        and then not Is_Access_Constant (E);
+      return Is_Access_Type (E)
+        and then not Is_Access_Constant (E)
+        and then Ekind (Directly_Designated_Type (E)) /= E_Subprogram_Type;
    end Is_Access_Variable;
 
    -----------------------------


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

only message in thread, other threads:[~2021-06-15 10:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-15 10:22 [gcc r12-1471] [Ada] Fix detection of access-to-variable types 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).