From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id A099D385694E for ; Mon, 12 Sep 2022 17:39:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A099D385694E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663004351; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=KIW0RhhoUFTjP9sTvE8epQ1ef2VJ1up+b1x/zFMLtoE=; b=YTKUNJvEdCwPfHJU9Lf/kte/X/H0st9Y/Dv2Ys5Ry4A97z0sVfzQ5mbhZxxthTSdZDTmff uRB6o0fNBOWvMH9Lipf3YSEzOaguJOxye3B+/L1NPgs2cITSX5pe+6lrD9kc5ostNlXq1n 7erMxVgcahnyhcXlMJTLCgiqiliUGps= Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-125-IfPFRbZyPd2Znvhcil0g5g-1; Mon, 12 Sep 2022 13:39:10 -0400 X-MC-Unique: IfPFRbZyPd2Znvhcil0g5g-1 Received: by mail-qk1-f197.google.com with SMTP id bl17-20020a05620a1a9100b006cdf19243acso5630896qkb.4 for ; Mon, 12 Sep 2022 10:39:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date; bh=KIW0RhhoUFTjP9sTvE8epQ1ef2VJ1up+b1x/zFMLtoE=; b=OQgC0eZ1RgtGV49ZGMP1q+cCuYMLQYT7GM3UbCL2k47+UoWLRmfizcQ3CYBjeCFUl0 4tfuO4+uihbCwusevU+VuQ4407Q33s6/C9VZJOFKdsirsfwG0213gHPKktNJRn7VM/tM 9RaX8vzSwmHATQrrF8p+CRhvGYq/ptpgYnCcos9nqzLYc0uowPdmjHswJkbaEFkgqHDI Qh/IUh8mlYMfPRJP6R1INcoTRGiiIZLFybuiXIKtL7Gn5Y4ff5g3HnesEvHHUY/f6QbC DzL/iSvx5f/WYnAnYb7wVp/fB2cbxkkDUkDBCVFlVQM2UF47KFvv1EnExZxG7NAeXovu 18NA== X-Gm-Message-State: ACgBeo2s9Kdh8CSIV2Gt5MTlf3Gf1b0Y1FugLoWYdoR4C3g098sLfVXQ wWdNPtQbuGbWTsG0+ZlqCslxCa+hvhD51B9tE+IPnZm9fRRZ6FT41mHmGe3jrUUPUn/0a0KaJ8R BD2HFD2a+QkYPFTpWqj7GiTkQCwyC/qJ8ycV+Wj6BriSTCmVDObd2i5nNI7PHs0Ce0pI= X-Received: by 2002:ac8:4e49:0:b0:343:620e:fd53 with SMTP id e9-20020ac84e49000000b00343620efd53mr25496887qtw.71.1663004349784; Mon, 12 Sep 2022 10:39:09 -0700 (PDT) X-Google-Smtp-Source: AA6agR6EXVcTlq3TSgO+yMaE8qcVYYm4VHnIfqV6SmuZv0r4gNGXG8oIkDeZ/PIT+baOWR8hKATIyA== X-Received: by 2002:ac8:4e49:0:b0:343:620e:fd53 with SMTP id e9-20020ac84e49000000b00343620efd53mr25496865qtw.71.1663004349529; Mon, 12 Sep 2022 10:39:09 -0700 (PDT) Received: from localhost.localdomain (ool-457670bb.dyn.optonline.net. [69.118.112.187]) by smtp.gmail.com with ESMTPSA id s13-20020a05620a0bcd00b006aedb35d8a1sm7796870qki.74.2022.09.12.10.39.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Sep 2022 10:39:09 -0700 (PDT) From: Patrick Palka To: gcc-patches@gcc.gnu.org Cc: libstdc++@gcc.gnu.org, Patrick Palka Subject: [PATCH] libstdc++: Squelch -Wparentheses warning with debug iterators Date: Mon, 12 Sep 2022 13:39:07 -0400 Message-Id: <20220912173907.1766341-1-ppalka@redhat.com> X-Mailer: git-send-email 2.37.3.542.gdd3f6c4cae MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-14.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: 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] Tested on x86_64-pc-linux-gnu, does this look OK for trunk? libstdc++-v3/ChangeLog: * include/debug/safe_iterator.h (_GLIBCXX_DEBUG_VERIFY_OPERANDS): Add parentheses to squelch -Wparentheses. --- 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) \ -- 2.37.3.542.gdd3f6c4cae