public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-1105] ada: A discriminant of a variable is not a variable
@ 2023-05-23  8:07 Marc Poulhi?s
  0 siblings, 0 replies; only message in thread
From: Marc Poulhi?s @ 2023-05-23  8:07 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:0fb36084e3ef8fb0eef232b41a8257f119b26864

commit r14-1105-g0fb36084e3ef8fb0eef232b41a8257f119b26864
Author: Steve Baird <baird@adacore.com>
Date:   Wed Feb 15 16:13:06 2023 -0800

    ada: A discriminant of a variable is not a variable
    
    gcc/ada/
    
            * sem_util.adb
            (Is_Variable): Correctly return False for a selected component
            name of the form Some_Object.Some_Discriminant, even if
            Some_Object is a variable. We don't want to allow such a name as
            an actual parameter in a call if the corresponding formal
            parameter's mode is not "in".

Diff:
---
 gcc/ada/sem_util.adb | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb
index baf4cefdfb3..7e302897888 100644
--- a/gcc/ada/sem_util.adb
+++ b/gcc/ada/sem_util.adb
@@ -21196,11 +21196,8 @@ package body Sem_Util is
                return Is_Variable_Prefix (Prefix (Orig_Node));
 
             when N_Selected_Component =>
-               return (Is_Variable (Selector_Name (Orig_Node))
-                        and then Is_Variable_Prefix (Prefix (Orig_Node)))
-                 or else
-                   (Nkind (N) = N_Expanded_Name
-                     and then Scope (Entity (N)) = Entity (Prefix (N)));
+               return Is_Variable (Selector_Name (Orig_Node))
+                       and then Is_Variable_Prefix (Prefix (Orig_Node));
 
             --  For an explicit dereference, the type of the prefix cannot
             --  be an access to constant or an access to subprogram.

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

only message in thread, other threads:[~2023-05-23  8:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-23  8:07 [gcc r14-1105] ada: A discriminant of a variable is not a variable Marc Poulhi?s

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).