Skip to content

Commit

Permalink
[clang] Fix unexpected -Wconstant-logical-operand in C23 (llvm#80724)
Browse files Browse the repository at this point in the history
C23 has `bool`, but logical operators still return int. Check that
we're not in C to avoid false-positive -Wconstant-logical-operand.

Fixes llvm#64356

(cherry picked from commit a18e92d)
  • Loading branch information
Fznamznon authored and Shivam Gupta committed Sep 2, 2024
1 parent 8ad1204 commit 62dcef1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions clang/docs/ReleaseNotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,10 @@ Bug Fixes in This Version
- Fixed a crash when diagnosing format strings and encountering an empty
delimited escape sequence (e.g., ``"\o{}"``). #GH102218

- Clang now doesn't produce false-positive warning `-Wconstant-logical-operand`
for logical operators in C23.
Fixes (`#64356 <https://github.com/llvm/llvm-project/issues/64356>`_).

Bug Fixes to Compiler Builtins
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Expand Down

0 comments on commit 62dcef1

Please sign in to comment.