r365395 - Add parentheses to silence warnings.

Bill Wendling via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 8 15:01:07 PDT 2019


Author: void
Date: Mon Jul  8 15:01:07 2019
New Revision: 365395

URL: http://llvm.org/viewvc/llvm-project?rev=365395&view=rev
Log:
Add parentheses to silence warnings.

Modified:
    cfe/trunk/lib/Tooling/Syntax/BuildTree.cpp

Modified: cfe/trunk/lib/Tooling/Syntax/BuildTree.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Tooling/Syntax/BuildTree.cpp?rev=365395&r1=365394&r2=365395&view=diff
==============================================================================
--- cfe/trunk/lib/Tooling/Syntax/BuildTree.cpp (original)
+++ cfe/trunk/lib/Tooling/Syntax/BuildTree.cpp Mon Jul  8 15:01:07 2019
@@ -110,9 +110,9 @@ private:
       auto It = Trees.lower_bound(Range.begin());
       assert(It != Trees.end() && "no node found");
       assert(It->first == Range.begin() && "no child with the specified range");
-      assert(std::next(It) == Trees.end() ||
-             std::next(It)->first == Range.end() &&
-                 "no child with the specified range");
+      assert((std::next(It) == Trees.end() ||
+              std::next(It)->first == Range.end()) &&
+             "no child with the specified range");
       It->second.Role = Role;
     }
 
@@ -129,9 +129,9 @@ private:
              BeginChildren->first == FirstToken &&
              "fold crosses boundaries of existing subtrees");
       auto EndChildren = Trees.lower_bound(NodeTokens.end());
-      assert(EndChildren == Trees.end() ||
-             EndChildren->first == NodeTokens.end() &&
-                 "fold crosses boundaries of existing subtrees");
+      assert((EndChildren == Trees.end() ||
+              EndChildren->first == NodeTokens.end()) &&
+             "fold crosses boundaries of existing subtrees");
 
       // (!) we need to go in reverse order, because we can only prepend.
       for (auto It = EndChildren; It != BeginChildren; --It)




More information about the cfe-commits mailing list