[all-commits] [llvm/llvm-project] b732e1: [Clang] Default the warning for chained comparison...

cor3ntin via All-commits all-commits at lists.llvm.org
Fri Feb 21 06:52:32 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b732e14cb5681abff78e3873987a2a8b39549c83
      https://github.com/llvm/llvm-project/commit/b732e14cb5681abff78e3873987a2a8b39549c83
  Author: cor3ntin <corentinjabot at gmail.com>
  Date:   2025-02-21 (Fri, 21 Feb 2025)

  Changed paths:
    M clang-tools-extra/test/clang-tidy/checkers/bugprone/chained-comparison.c
    M clang-tools-extra/test/clang-tidy/checkers/bugprone/chained-comparison.cpp
    M clang/docs/ReleaseNotes.rst
    M clang/include/clang/Basic/DiagnosticSemaKinds.td
    M clang/test/Sema/bool-compare.c
    M clang/test/Sema/parentheses.cpp
    M clang/test/SemaCXX/bool-compare.cpp
    M clang/test/SemaCXX/cxx2a-adl-only-template-id.cpp
    M clang/test/SemaTemplate/typo-dependent-name.cpp
    M clang/test/SemaTemplate/typo-template-name.cpp

  Log Message:
  -----------
  [Clang] Default the warning for chained comparison to an error. (#128145)

Boolean constructs of the form `a < b < c`
never express the likely intent of the user and
we have been warning on them since clang 19.

WG21 is likely to deprecate or make that construct in the future. To
gain more experience and to improve safety, this patches preempt future
language evolution by turning
warn_consecutive_comparison in an error, by default (which can be
disabled with `-Wno-error=parentheses`)



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