r373828 - [Diagnostics] Highlight expr's source range for -Wbool-operation

David Bolvansky via cfe-commits cfe-commits at lists.llvm.org
Sat Oct 5 06:28:15 PDT 2019


Author: xbolva00
Date: Sat Oct  5 06:28:15 2019
New Revision: 373828

URL: http://llvm.org/viewvc/llvm-project?rev=373828&view=rev
Log:
[Diagnostics] Highlight expr's source range for -Wbool-operation

Warning message looks better; and GCC adds it too.


Modified:
    cfe/trunk/lib/Sema/SemaExpr.cpp

Modified: cfe/trunk/lib/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=373828&r1=373827&r2=373828&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExpr.cpp Sat Oct  5 06:28:15 2019
@@ -13481,6 +13481,7 @@ ExprResult Sema::CreateBuiltinUnaryOp(So
           << 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;




More information about the cfe-commits mailing list