public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-1273] ada: Tune detection of expression functions within a declare expression
@ 2023-05-26  7:36 Marc Poulhi?s
  0 siblings, 0 replies; only message in thread
From: Marc Poulhi?s @ 2023-05-26  7:36 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:4f591201821b4e236f79486fa3ae881a8b2d5212

commit r14-1273-g4f591201821b4e236f79486fa3ae881a8b2d5212
Author: Piotr Trojanek <trojanek@adacore.com>
Date:   Wed Feb 1 20:41:49 2023 +0100

    ada: Tune detection of expression functions within a declare expression
    
    Code cleanup; semantics is unaffected.
    
    gcc/ada/
    
            * sem_ch4.adb (Check_Action_OK): Replace low-level test with a
            high-level routine.
            * sem_ch13.adb (Is_Predicate_Static): Likewise.

Diff:
---
 gcc/ada/sem_ch13.adb | 2 +-
 gcc/ada/sem_ch4.adb  | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb
index b13af26b561..958b26ebb0d 100644
--- a/gcc/ada/sem_ch13.adb
+++ b/gcc/ada/sem_ch13.adb
@@ -14261,7 +14261,7 @@ package body Sem_Ch13 is
       --   transformed into just "(S /= 0)", which would appear to be
       --   a predicate-static expression (and therefore legal).
 
-      if Original_Node (Expr) /= Expr then
+      if Is_Rewrite_Substitution (Expr) then
 
          --  Emit warnings for predicates that are always True or always False
          --  and were not originally expressed as Boolean literals.
diff --git a/gcc/ada/sem_ch4.adb b/gcc/ada/sem_ch4.adb
index a85c988fe46..c8bb99b6716 100644
--- a/gcc/ada/sem_ch4.adb
+++ b/gcc/ada/sem_ch4.adb
@@ -2371,11 +2371,11 @@ package body Sem_Ch4 is
          if not Comes_From_Source (N) or else not Comes_From_Source (A) then
 
             --  If, for example, an (illegal) expression function is
-            --  transformed into a"vanilla" function then we don't want to
+            --  transformed into a "vanilla" function then we don't want to
             --  allow it just because Comes_From_Source is now False. So look
             --  at the Original_Node.
 
-            if A /= Original_Node (A) then
+            if Is_Rewrite_Substitution (A) then
                Check_Action_OK (Original_Node (A));
             end if;

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

only message in thread, other threads:[~2023-05-26  7:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-26  7:36 [gcc r14-1273] ada: Tune detection of expression functions within a declare expression 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).