PR 81271: gcc/cp/lex.c:116: wrong condition ?

Message ID CAP8tkpD7yjEcakda930BnQPfmO6Sd=AMANiuvn7_yERpZnB8eA@mail.gmail.com
State Not Applicable
Headers
Series PR 81271: gcc/cp/lex.c:116: wrong condition ? |

Checks

Context Check Description
snail/gcc-patch-check fail Git am fail log

Commit Message

Jasmine Tang Jan. 24, 2024, 6:02 a.m. UTC
  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 <tanghocle456@gmail.com>
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(-)
  

Patch

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;