From 83b81c1f6ee878ffe458aee3162ce0ef004d3374 Mon Sep 17 00:00:00 2001 From: David Bolvansky Date: Sat, 5 Oct 2019 13:28:15 +0000 Subject: [Diagnostics] Highlight expr's source range for -Wbool-operation Warning message looks better; and GCC adds it too. llvm-svn: 373828 --- clang/lib/Sema/SemaExpr.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'clang/lib/Sema/SemaExpr.cpp') diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index c18f54cefde..3cb999dacc4 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/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; -- cgit v1.2.3