r349934 - [AST][NFC] Fix Wsign-compare warning introduced in CXXOperatorCallExpr

Bruno Ricci via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 21 09:54:51 PST 2018


Author: brunoricci
Date: Fri Dec 21 09:54:51 2018
New Revision: 349934

URL: http://llvm.org/viewvc/llvm-project?rev=349934&view=rev
Log:
[AST][NFC] Fix Wsign-compare warning introduced in CXXOperatorCallExpr


Modified:
    cfe/trunk/lib/AST/ExprCXX.cpp

Modified: cfe/trunk/lib/AST/ExprCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ExprCXX.cpp?rev=349934&r1=349933&r2=349934&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ExprCXX.cpp (original)
+++ cfe/trunk/lib/AST/ExprCXX.cpp Fri Dec 21 09:54:51 2018
@@ -488,8 +488,9 @@ CXXOperatorCallExpr::CXXOperatorCallExpr
                OperatorLoc, /*MinNumArgs=*/0, UsesADL) {
   CXXOperatorCallExprBits.OperatorKind = OpKind;
   CXXOperatorCallExprBits.FPFeatures = FPFeatures.getInt();
-  assert((CXXOperatorCallExprBits.OperatorKind == OpKind) &&
-         "OperatorKind overflow!");
+  assert(
+      (CXXOperatorCallExprBits.OperatorKind == static_cast<unsigned>(OpKind)) &&
+      "OperatorKind overflow!");
   assert((CXXOperatorCallExprBits.FPFeatures == FPFeatures.getInt()) &&
          "FPFeatures overflow!");
   Range = getSourceRangeImpl();




More information about the cfe-commits mailing list