From patchwork Mon Sep 12 17:39:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Patrick Palka X-Patchwork-Id: 1170 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5044:0:0:0:0:0 with SMTP id h4csp1983625wrt; Mon, 12 Sep 2022 10:39:55 -0700 (PDT) X-Google-Smtp-Source: AA6agR7zQhUvojdEMRI41LiXeCfHJQFjTzu7aFzQZioVa1NGHHHTHLU9dXbyDzIhARjtn9XAthq+ X-Received: by 2002:a05:6402:33c5:b0:447:e4a3:c930 with SMTP id a5-20020a05640233c500b00447e4a3c930mr22922443edc.401.1663004395759; Mon, 12 Sep 2022 10:39:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663004395; cv=none; d=google.com; s=arc-20160816; b=kJs5YCYOdPKs4pJoIAJsOjxgeR+OpZbOaPJRE/23Skp8M6XWbKWF+Z/yF08CbuzD7N C9HjSf+WsCXHd16vMs+xhuEc8rSuu33HCjPDz5nJOrGo1TCatXXv+p7APn/nrcst94jG BWkrxl7hai+fH03nft8xOVNbxhB3FvlJl50lu4OkIXrpocxfDqgpuellOEaNfkmJlawf xYW8z6071L+zYjLHMdCAx1SBnP01boT6YbOH63UyTzDpDGpaP13I4azcXzP9Td8Yuled yv5AveCW0RI/Qr8EACedmK8nRJHjAqArDJvypOhp78NnlNETvBSMuuIHFfibzq2P8/4z DihA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:reply-to:from:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:to :dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=KIW0RhhoUFTjP9sTvE8epQ1ef2VJ1up+b1x/zFMLtoE=; b=kyWQwbY29B8qWGlGqs7UejxRTAv4z1BbdYdvX4OZ7S+0NiQJDIFP95X3OEQNdkPZVv mNrgG/hP0RnjOk3u4C08IVLmb917vICg9TkUUI1664PIel1Dq4e8nCYmUfjnx/lYS2t5 kvtX7ogFAv0SzdSw/4FaUEL4Yk37AHSoWBJHca546zqIgCyUMGD/HohYqjIthgglNuJ1 Xt2boR8Wk3aYi64chbweL+/wxx9fNsY32vdwCQdoVIpcrRwn+6iiPq/cHyDkev4Vjeh8 fwkvBJJJIu3/0VNmNmbJTXkx5J3+6fs228pzMv1Mla8xqk5RFMZZrqdJdWbF3Qky6rRm NGXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=ifdhQd0A; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id sh33-20020a1709076ea100b0077537c14200si8035879ejc.205.2022.09.12.10.39.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Sep 2022 10:39:55 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=ifdhQd0A; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 69C2B38AA271 for ; Mon, 12 Sep 2022 17:39:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 69C2B38AA271 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1663004394; bh=KIW0RhhoUFTjP9sTvE8epQ1ef2VJ1up+b1x/zFMLtoE=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=ifdhQd0AruPbx/Y8TaW4QZR3N23CunLOY23/6/6XAqffdMkd8fvqNpMqo/Vy9M6us ck/lHVU/DlxKuU12dGtghrU/u/fvA8q96xBp8JzYvAeyad6m1DqLss5/zGvWTo7tkl 6T2K5OFswoCT0PlwtkqLxoiMDVqvKapK+Y27PdEk= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org 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 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-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) To: gcc-patches@gcc.gnu.org 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 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 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Patrick Palka via Gcc-patches From: Patrick Palka Reply-To: Patrick Palka Cc: libstdc++@gcc.gnu.org Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1743786497051892483?= X-GMAIL-MSGID: =?utf-8?q?1743786497051892483?= 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) \