public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-175] [Ada] Remove doubly-negated tests for empty lists
@ 2022-05-09  9:30 Pierre-Marie de Rodat
  0 siblings, 0 replies; only message in thread
From: Pierre-Marie de Rodat @ 2022-05-09  9:30 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:8e13160b101177b4d0783934d39aab2e2c7b50d9

commit r13-175-g8e13160b101177b4d0783934d39aab2e2c7b50d9
Author: Piotr Trojanek <trojanek@adacore.com>
Date:   Mon Jan 10 14:21:17 2022 +0100

    [Ada] Remove doubly-negated tests for empty lists
    
    Replace "not Is_Non_Empty_List (...)" with "Is_Empty_List (...)".
    
    Code cleanup; semantics is unaffected.
    
    gcc/ada/
    
            * exp_ch5.adb (Update_Choice_Index): Simplify condition.
            * sem_ch8.adb (Attribute_Renaming): Likewise.

Diff:
---
 gcc/ada/exp_ch5.adb | 3 +--
 gcc/ada/sem_ch8.adb | 2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/gcc/ada/exp_ch5.adb b/gcc/ada/exp_ch5.adb
index b38e3f54f67..b78c127e7f4 100644
--- a/gcc/ada/exp_ch5.adb
+++ b/gcc/ada/exp_ch5.adb
@@ -3563,8 +3563,7 @@ package body Exp_Ch5 is
                         --  is ok here.
                         --
                         pragma Assert
-                          (not Is_Non_Empty_List
-                                 (Component_Associations (Pattern)));
+                          (Is_Empty_List (Component_Associations (Pattern)));
 
                         declare
                            Agg_Length : constant Node_Id :=
diff --git a/gcc/ada/sem_ch8.adb b/gcc/ada/sem_ch8.adb
index e5756029246..c40e1243a20 100644
--- a/gcc/ada/sem_ch8.adb
+++ b/gcc/ada/sem_ch8.adb
@@ -4532,7 +4532,7 @@ package body Sem_Ch8 is
       --  have at least one formal parameter, with the exceptions of the GNAT
       --  attribute 'Img, which GNAT treats as renameable.
 
-      if not Is_Non_Empty_List (Parameter_Specifications (Spec)) then
+      if Is_Empty_List (Parameter_Specifications (Spec)) then
          if Aname /= Name_Img then
             Error_Msg_N
               ("subprogram renaming an attribute must have formals", N);


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

only message in thread, other threads:[~2022-05-09  9:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-09  9:30 [gcc r13-175] [Ada] Remove doubly-negated tests for empty lists 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).