From patchwork Wed Jan 24 06:02:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jasmine Tang X-Patchwork-Id: 191380 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:2553:b0:103:945f:af90 with SMTP id p19csp798969dyi; Tue, 23 Jan 2024 22:03:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IFrcg2SWGexc+8tv1LWKmT4cdb0xggT+wgg+FCRT0tIASB3Fl61+2p/27wi+qbAJMxwo8EZ X-Received: by 2002:a05:620a:136f:b0:783:74c3:1397 with SMTP id d15-20020a05620a136f00b0078374c31397mr8118166qkl.149.1706076188854; Tue, 23 Jan 2024 22:03:08 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706076188; cv=pass; d=google.com; s=arc-20160816; b=QnDMrvyvJeL5+4jgH8MiYaodP8QdUHrAevjDd2rLu6fE01uVnI7X01E2ncx2yls9gx t0iPPIYY8xhHhav7lvtzjy998MePWL9ff7zrq2oFGouXSXVAo3Jo6j2Mq28Aw03Ro4ei RsmIWJ5DbW5Tsihw/yDcVljn+xEFWECSM/KXgnTLTzqqbZPmGpfcQmiV7kggUa640dtU NuLadp7zvQo702LL5sLarCMbI1UB2TK9vUTVTifhCB7W2+TU1ZMgqCmGeRQpK2zZUann d+stV4vOV9eDjOvuGBhvga5EwT5UG1tKN6n6Jh+peC/vZJj/b6SRMonB0P1aprQNvSTB q29w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:to:subject:message-id:date:from :mime-version:dkim-signature:arc-filter:dmarc-filter:delivered-to; bh=dvIPG3x2EAFkCc6umeWaOv2VdRI6pHzat/v6rdHeWO4=; fh=hPrbWPhweUx4V0GV9uXJqbyAzg2ABmTz7kczrAQqMmM=; b=K/0q/HwCKuwTBwMHVfdEbufn7VlX1QYMwkQCp1wUPr5vF3vAg0bsKk9u+43Q7vy0Mq p0W3bk+Y8RlAg3ZRUdhG6jGcdIjXWOcU7F46ZD3TZ0MtK8tAQ9fUxkOOpjxlXe61Q8bt uwlhkhcy5RodMUAJIMXPQX18/hZi0cBwsr4D0E8OCeuvN3zt9zdtlLMj0BRBXsc3XfpJ udlDfeVlbfNlJrd/bqjH0m5XvXMrNN+1l5Zokq4pMrX91ltwdDV5B7zfCd9Lx6zIjk/w IU674T/TyfSFOCF/xAxrcXOHRaYB/3YHiikvfuDvmdcV9U7/tV2Ox9luAm5aQaMfgMLV XdwA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=g9lqjawx; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id cz36-20020a05620a36e400b00783939459d5si8601027qkb.527.2024.01.23.22.03.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 22:03:08 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=g9lqjawx; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8E6C23858CDA for ; Wed, 24 Jan 2024 06:03:08 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-vk1-xa33.google.com (mail-vk1-xa33.google.com [IPv6:2607:f8b0:4864:20::a33]) by sourceware.org (Postfix) with ESMTPS id 2D7713858D1E for ; Wed, 24 Jan 2024 06:02:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2D7713858D1E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 2D7713858D1E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::a33 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706076149; cv=none; b=YN9MuqtwiouaryGejIOfhhItIq0DdBXN8LdxbiUGT3CPYKmrjlpQEtS/VJrvylYOCMKJfcC4FIVkT5emVtO8UGPRscGVbD3YnEAvHl00XZEVeoD/hJRE2pLjye0EYvy68mv8A1SCyhzaKvLAn6bcVJUSJIn1YMjP2TB0DDcyd30= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706076149; c=relaxed/simple; bh=2kbNHKQtgTPqVPjGD+fQop7y97XUV0dbicDUyEwUnR0=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=tldth9WiwHvHIj6MIC+Kh1mxX4aZlgQjXFARy6R/JUCeznXPaVKQEPvjtSWdBtMHOa99DnXRu3PsLRDbVBzKuUq4+knA+HqwghsVtbW+dYAfKhzYlaOjZStA/k/QTjX+Tr/ffTR1fpbZjKrDvouVIHL5ilFR6cmryHIg7L6visE= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-vk1-xa33.google.com with SMTP id 71dfb90a1353d-4bd2b1dc7d3so386786e0c.3 for ; Tue, 23 Jan 2024 22:02:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706076146; x=1706680946; darn=gcc.gnu.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=dvIPG3x2EAFkCc6umeWaOv2VdRI6pHzat/v6rdHeWO4=; b=g9lqjawx53cwazW6SQqGENi5/qTSiwkCjIiUsHHXhTPzGOzP91c+7YnbTqFDc8zoM+ YK4rnsGmgRsnxRtFY/hTCl9DolHeWzUzybXsFye3EKF0mkopFik5xl8jAtfx7xgD5g/3 YLH7vQO4NVUHDdv0J1hSVgQuGe82oWCALt80vkOkqj6aLNWVmQOqavbeseivhCBPRIiL FsqQ3xRcJ4uxwIFJf2ShZU/6hVXVMUwMJ/OkuassEeywqMu5PS0KZu1aq67+4o0m5yvs EKBoRqYoA0LREdt1/y/WtOXXqK2ej3yBdKc4RPy0xBSDioeeohy5hGmYYlh36/0LCh66 8PGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706076146; x=1706680946; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=dvIPG3x2EAFkCc6umeWaOv2VdRI6pHzat/v6rdHeWO4=; b=sOcCu+5pa5dHh3E57UAVhrQDUV/UKykONnsHt1pAC3NLc6dysux1CsisfBCHplhnVp FYuP5PbG51YiJWPRTLgefA4w2p2m/Po6NLSeOg3sIEei1+JgvptH4QlEjPHIBgsVorxJ nwEMbgmaH0kn2RPx+pgIDYt5qncc+tNLtZNHbGfOdCsP680UAmB/+1bRDRYE0MWZuLDM n2UKqrfozlrmp80KYZ067LfTt2jVRXePWfnlF6BxV7QN/jUot3xkZeftnVW0VM0Q+nkR u5GqfdfjNjYPIB8niH7HBJY9VixcQG0/eQkUFuOTytUHT9lZJgTL6eeuBcwjn2y5/HVC wUVw== X-Gm-Message-State: AOJu0Yx0iRJWaC2UJJWE0CCF0aOO3FjpmWAoyjhqwG+fztTb959G+35a IJAlSNDAeHu9ef2QJTdYvVOmfzY8k4EtI4FyTUFDvEv/bMGn1DDE/rGnQYiWYeDBTCmCtWY0FZ9 MhzqMFfX1GNYwquIalKyoKcxCbehPibjRSZqGUA== X-Received: by 2002:a05:6122:99b:b0:4b6:cc19:42dc with SMTP id g27-20020a056122099b00b004b6cc1942dcmr3472809vkd.11.1706076146255; Tue, 23 Jan 2024 22:02:26 -0800 (PST) MIME-Version: 1.0 From: Jasmine Tang Date: Tue, 23 Jan 2024 22:02:15 -0800 Message-ID: Subject: [patch] PR 81271: gcc/cp/lex.c:116: wrong condition ? To: gcc-patches@gcc.gnu.org X-Spam-Status: No, score=-10.2 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, GIT_PATCH_0, HTML_MESSAGE, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, 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.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1788950546127480032 X-GMAIL-MSGID: 1788950546127480032 Change the style from & to && to reflect boolean result with boolean operation (instead of bitwise operation) From 10b501ffa8a11c7f10fd6e6ab5d9a876a321fe13 Mon Sep 17 00:00:00 2001 From: Jasmine Date: Tue, 23 Jan 2024 21:18:13 -0800 Subject: [PATCH] Fix compiler warning: Boolean result is used in bitwise operation --- gcc/cp/lex.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/cp/lex.cc b/gcc/cp/lex.cc index 1110db7f8d0..8d94ae1e7b1 100644 --- a/gcc/cp/lex.cc +++ b/gcc/cp/lex.cc @@ -136,8 +136,8 @@ void set_identifier_kind (tree id, cp_identifier_kind kind) { gcc_checking_assert (!IDENTIFIER_KIND_BIT_2 (id) - & !IDENTIFIER_KIND_BIT_1 (id) - & !IDENTIFIER_KIND_BIT_0 (id)); + && !IDENTIFIER_KIND_BIT_1 (id) + && !IDENTIFIER_KIND_BIT_0 (id)); IDENTIFIER_KIND_BIT_2 (id) |= (kind >> 2) & 1; IDENTIFIER_KIND_BIT_1 (id) |= (kind >> 1) & 1; IDENTIFIER_KIND_BIT_0 (id) |= (kind >> 0) & 1;