From 2b7e3dd2fddbff36efd67e6332debbca0b6c2f81 Mon Sep 17 00:00:00 2001 From: David Bolvansky Date: Sat, 5 Oct 2019 13:28:15 +0000 Subject: [PATCH] [Diagnostics] Highlight expr's source range for -Wbool-operation Warning message looks better; and GCC adds it too. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@373828 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Sema/SemaExpr.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index c18f54cefd..3cb999dacc 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -13481,6 +13481,7 @@ ExprResult Sema::CreateBuiltinUnaryOp(SourceLocation OpLoc, << resultType << Input.get()->getSourceRange(); else if (Input.get()->isKnownToHaveBooleanValue()) Diag(OpLoc, diag::warn_bitwise_negation_bool) + << Input.get()->getSourceRange() << FixItHint::CreateReplacement(OpLoc, "!"); else if (resultType->hasIntegerRepresentation()) break; -- 2.40.0