[all-commits] [llvm/llvm-project] 93f0f3: [Clang] add -Wshift-bool warning to handle shiftin...

Oleksandr T. via All-commits all-commits at lists.llvm.org
Thu Mar 6 15:06:17 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 93f0f3d33be596321730e9194cf24a73a75ce702
      https://github.com/llvm/llvm-project/commit/93f0f3d33be596321730e9194cf24a73a75ce702
  Author: Oleksandr T. <oleksandr.tarasiuk at outlook.com>
  Date:   2025-03-07 (Fri, 07 Mar 2025)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/include/clang/Basic/DiagnosticSemaKinds.td
    M clang/lib/Sema/SemaExpr.cpp
    A clang/test/Sema/shift-bool.cpp

  Log Message:
  -----------
  [Clang] add -Wshift-bool warning to handle shifting of bool (#127336)

Fixes #28334

--- 

This PR introduces the `-Wshift-bool` warning to detect and warn against
shifting `bool` values using the `>>` operator. Shifting a `bool`
implicitly converts it to an `int`, which can lead to unintended
behavior.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list