https://github.com/pileghoff created https://github.com/llvm/llvm-project/pull/79588
Fixes #79435 Im not sure if this is the best solution, but it seems to work well. Should i be adding tests for this? If i should, i would need some help on how. I was able to run the test suite, but i have no idea where this test would go. My guess would be `tautological-constant-compare.c`, but that test seems to be C++ specific. >From cdacba44198ed9925cbc2cd9e6c79a9b74265b4f Mon Sep 17 00:00:00 2001 From: Pil Eghoff <p...@bang-olufsen.dk> Date: Fri, 26 Jan 2024 13:30:17 +0100 Subject: [PATCH] [Sema] Fix c23 not checking CheckBoolLikeConversion --- clang/lib/Sema/SemaChecking.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp index 4d280f25cc04c2..8e3bd1cd46076d 100644 --- a/clang/lib/Sema/SemaChecking.cpp +++ b/clang/lib/Sema/SemaChecking.cpp @@ -16166,7 +16166,7 @@ static void CheckConditionalOperator(Sema &S, AbstractConditionalOperator *E, /// Check conversion of given expression to boolean. /// Input argument E is a logical expression. static void CheckBoolLikeConversion(Sema &S, Expr *E, SourceLocation CC) { - if (S.getLangOpts().Bool) + if (S.getLangOpts().Bool && !S.getLangOpts().C23) return; if (E->IgnoreParenImpCasts()->getType()->isAtomicType()) return; _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits