From d38240310224ebe232ed2c2de1aeed71f1414cf2 Mon Sep 17 00:00:00 2001 From: Mariya Podchishchaeva Date: Tue, 6 Feb 2024 15:57:35 +0300 Subject: [PATCH] [clang] Fix unexpected `-Wconstant-logical-operand` in C23 (#80724) C23 has `bool`, but logical operators still return int. Check that we're not in C to avoid false-positive -Wconstant-logical-operand. Fixes https://github.com/llvm/llvm-project/issues/64356 (cherry picked from commit a18e92d020b895b712175a3b13a3d021608115a7) --- clang/docs/ReleaseNotes.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/clang/docs/ReleaseNotes.rst b/clang/docs/ReleaseNotes.rst index 46270d9a1a79cc0..8022991ea165e46 100644 --- a/clang/docs/ReleaseNotes.rst +++ b/clang/docs/ReleaseNotes.rst @@ -901,6 +901,10 @@ Bug Fixes in This Version - Fixed the definition of ``ATOMIC_FLAG_INIT`` in ```` so it can be used in C++. +- Clang now doesn't produce false-positive warning `-Wconstant-logical-operand` + for logical operators in C23. + Fixes (`#64356 `_). + Bug Fixes to Compiler Builtins ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^