[clang] a867cb8 - [clang] Fix a warning

Kazu Hirata via cfe-commits cfe-commits at lists.llvm.org
Sat Oct 15 12:48:32 PDT 2022


Author: Kazu Hirata
Date: 2022-10-15T12:48:23-07:00
New Revision: a867cb849ad0ef2e56c63ce091b74aa0497beef8

URL: https://github.com/llvm/llvm-project/commit/a867cb849ad0ef2e56c63ce091b74aa0497beef8
DIFF: https://github.com/llvm/llvm-project/commit/a867cb849ad0ef2e56c63ce091b74aa0497beef8.diff

LOG: [clang] Fix a warning

This patch fixes:

  clang/lib/Basic/SourceManager.cpp:2131:72: warning: suggest
  parentheses around ‘&&’ within ‘||’ [-Wparentheses]

Added: 
    

Modified: 
    clang/lib/Basic/SourceManager.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Basic/SourceManager.cpp b/clang/lib/Basic/SourceManager.cpp
index 7229561394e32..6aae581be8001 100644
--- a/clang/lib/Basic/SourceManager.cpp
+++ b/clang/lib/Basic/SourceManager.cpp
@@ -2126,10 +2126,11 @@ std::pair<bool, bool> SourceManager::isInTheSameTranslationUnit(
       // doesn't matter as these are never mixed in macro expansion.
       unsigned LParent = I->second.ParentFID.ID;
       unsigned RParent = Parent.ID;
-      assert((LOffs.second != ROffs.second) || (LParent == 0 || RParent == 0) ||
-             isInSameSLocAddrSpace(getComposedLoc(I->second.ParentFID, 0),
-                                   getComposedLoc(Parent, 0), nullptr) &&
-                 "Mixed local/loaded FileIDs with same include location?");
+      assert(((LOffs.second != ROffs.second) ||
+              (LParent == 0 || RParent == 0) ||
+              isInSameSLocAddrSpace(getComposedLoc(I->second.ParentFID, 0),
+                                    getComposedLoc(Parent, 0), nullptr)) &&
+             "Mixed local/loaded FileIDs with same include location?");
       IsBeforeInTUCache.setCommonLoc(LOffs.first, LOffs.second, ROffs.second,
                                      LParent < RParent);
       return std::make_pair(


        


More information about the cfe-commits mailing list