public inbox for libstdc++-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-2648] libstdc++: Avoid -Wparentheses warning with debug iterators
@ 2022-09-13 14:42 Patrick Palka
  0 siblings, 0 replies; only message in thread
From: Patrick Palka @ 2022-09-13 14:42 UTC (permalink / raw)
  To: gcc-cvs, libstdc++-cvs

https://gcc.gnu.org/g:edf6fe7800369136c1a8ddcaf75a042a3a938c84

commit r13-2648-gedf6fe7800369136c1a8ddcaf75a042a3a938c84
Author: Patrick Palka <ppalka@redhat.com>
Date:   Tue Sep 13 10:41:47 2022 -0400

    libstdc++: Avoid -Wparentheses warning with debug iterators
    
    I noticed compiling e.g. std/ranges/adaptors/join.cc with
    -D_GLIBCXX_DEBUG -Wsystem-headers -Wall gives the warning:
    
      gcc/libstdc++-v3/include/debug/safe_iterator.h:477:9: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses]
    
    libstdc++-v3/ChangeLog:
    
            * include/debug/safe_iterator.h (_GLIBCXX_DEBUG_VERIFY_OPERANDS):
            Add parentheses to avoid -Wparentheses warning.

Diff:
---
 libstdc++-v3/include/debug/safe_iterator.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libstdc++-v3/include/debug/safe_iterator.h b/libstdc++-v3/include/debug/safe_iterator.h
index 33f7a86478a..117dc93de60 100644
--- a/libstdc++-v3/include/debug/safe_iterator.h
+++ b/libstdc++-v3/include/debug/safe_iterator.h
@@ -40,7 +40,7 @@
 #endif
 
 #define _GLIBCXX_DEBUG_VERIFY_OPERANDS(_Lhs, _Rhs, _BadMsgId, _DiffMsgId) \
-  _GLIBCXX_DEBUG_VERIFY(!_Lhs._M_singular() && !_Rhs._M_singular()	\
+  _GLIBCXX_DEBUG_VERIFY((!_Lhs._M_singular() && !_Rhs._M_singular())	\
 			|| (_Lhs._M_value_initialized()			\
 			    && _Rhs._M_value_initialized()),		\
 			_M_message(_BadMsgId)				\

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

only message in thread, other threads:[~2022-09-13 14:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-13 14:42 [gcc r13-2648] libstdc++: Avoid -Wparentheses warning with debug iterators Patrick Palka

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