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 A13FF3898399 for ; Mon, 12 Sep 2022 17:39:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org A13FF3898399 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-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-125-RH0ezy94MPewuN4YoRB7nw-1; Mon, 12 Sep 2022 13:39:10 -0400 X-MC-Unique: RH0ezy94MPewuN4YoRB7nw-1 Received: by mail-qv1-f72.google.com with SMTP id nm17-20020a0562143b1100b004a5a3002d87so6205022qvb.8 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=1WYez2rOR0Xk+n6u1Wo7if7nYU2XRgGxGpwV2tzD8jp2vwJK/YMmbIygAuVHKJ3CIL RUgqwwRATSirVHn2jmimH3Gn6bThmJhir0WeYqbhDuOc/A2oXa9oucwoAS//jRWUhuzh UUhAydYhdobS7VuvtCHjJKwbBOcJvpP+tDMcz/eJHLCQ+yZS/jkFOPZxDPddblSpdv/J Ji5rrTZEHgsuWSblTUllvVDnqtmPtF5Cwp85iX8E9uOiQtkoCRQI5C2fyYhY5mlQ3zNG 0lWChiKRzD+7+awxeQGIAdZVpN/051DRvVh+93IvKcZp3AZAXUU3ImcoVTv+5S8eBw4W 1ydg== X-Gm-Message-State: ACgBeo0LY/KEyrfvFCycu/0JdW7Fi6KXC0wFYPzflVOqGb4+XTmnubXi ni29mQ3oUYZLdOIgmSYwc5W22GGnzSxrrgUtikXBHW1SKy2uiJNNt0gKw0ZPYYe2J6lg33q57Xf IHqw9X1/dUH/Kdi4= X-Received: by 2002:ac8:4e49:0:b0:343:620e:fd53 with SMTP id e9-20020ac84e49000000b00343620efd53mr25496881qtw.71.1663004349724; 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