[COMMITTED,11/14] ada: Remove redundant parentheses inside unary operators (cont.)

Message ID 20250113105349.928779-11-poulhies@adacore.com
State Committed
Commit 492aae16856e10cc44606953287192e345ec3294
Headers
Series [COMMITTED,01/14] ada: Fix parsing of raise expressions with no parens |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gcc_build--master-arm fail Patch failed to apply
linaro-tcwg-bot/tcwg_gcc_build--master-aarch64 fail Patch failed to apply

Commit Message

Marc Poulhiès Jan. 13, 2025, 10:53 a.m. UTC
  From: Piotr Trojanek <trojanek@adacore.com>

GNAT already emits a style warning when redundant parentheses appear inside
logical and short-circuit operators. A similar warning will be soon emitted for
unary operators as well. This patch removes the redundant parentheses to avoid
build errors.

gcc/ada/ChangeLog:

	* libgnat/a-strunb.ads: Remove redundant parentheses inside NOT
	operators.

Tested on x86_64-pc-linux-gnu, committed on master.

---
 gcc/ada/libgnat/a-strunb.ads | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
  

Patch

diff --git a/gcc/ada/libgnat/a-strunb.ads b/gcc/ada/libgnat/a-strunb.ads
index 5a1427c31a2..60d57954e5c 100644
--- a/gcc/ada/libgnat/a-strunb.ads
+++ b/gcc/ada/libgnat/a-strunb.ads
@@ -432,8 +432,8 @@  is
                       then J <= Index'Result - 1
                       else J - 1 in Index'Result
                                     .. Length (Source) - Pattern'Length)
-                  then not (Search.Match
-                    (To_String (Source), Pattern, Mapping, J)))),
+                  then not Search.Match
+                    (To_String (Source), Pattern, Mapping, J))),
 
         --  Otherwise, 0 is returned
 
@@ -485,8 +485,8 @@  is
                       then J <= Index'Result - 1
                       else J - 1 in Index'Result
                                     .. Length (Source) - Pattern'Length)
-                  then not (Search.Match
-                    (To_String (Source), Pattern, Mapping, J)))),
+                  then not Search.Match
+                    (To_String (Source), Pattern, Mapping, J))),
 
         --  Otherwise, 0 is returned
 
@@ -591,8 +591,8 @@  is
                       then J in From .. Index'Result - 1
                       else J - 1 in Index'Result
                                     .. From - Pattern'Length)
-                  then not (Search.Match
-                    (To_String (Source), Pattern, Mapping, J)))),
+                  then not Search.Match
+                    (To_String (Source), Pattern, Mapping, J))),
 
         --  Otherwise, 0 is returned
 
@@ -655,8 +655,8 @@  is
                       then J in From .. Index'Result - 1
                       else J - 1 in Index'Result
                                     .. From - Pattern'Length)
-                  then not (Search.Match
-                    (To_String (Source), Pattern, Mapping, J)))),
+                  then not Search.Match
+                    (To_String (Source), Pattern, Mapping, J))),
 
         --  Otherwise, 0 is returned