[clang] Fix unexpected `-Wconstant-logical-operand` in C23 (#80724)
authorMariya Podchishchaeva <mariya.podchishchaeva@intel.com>
Tue, 6 Feb 2024 12:57:35 +0000 (15:57 +0300)
committerTom Stellard <tstellar@redhat.com>
Fri, 9 Feb 2024 21:20:35 +0000 (13:20 -0800)
commita8158d8836e94ede76ea0cc749da2583511b7d89
tree9e565796f637e885bcd3c3ce103fc55274e341f6
parente6fa3ff6cc43f78000e56996a45f83acf53d2536
[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
clang/lib/Sema/SemaExpr.cpp
clang/test/Sema/warn-int-in-bool-context.c