[clang-tools-extra] a46c63c - Fix assigned-but-unused (except in an assert) warning with a void cast

David Blaikie via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 21 17:12:30 PDT 2021


Author: David Blaikie
Date: 2021-07-21T17:12:22-07:00
New Revision: a46c63c878a9e82ac2646926bb3d8237293ad15d

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

LOG: Fix assigned-but-unused (except in an assert) warning with a void cast

Added: 
    

Modified: 
    clang-tools-extra/clang-tidy/cppcoreguidelines/OwningMemoryCheck.cpp

Removed: 
    


################################################################################
diff  --git a/clang-tools-extra/clang-tidy/cppcoreguidelines/OwningMemoryCheck.cpp b/clang-tools-extra/clang-tidy/cppcoreguidelines/OwningMemoryCheck.cpp
index 9e3f0883ccd9a..f58cc06987fe8 100644
--- a/clang-tools-extra/clang-tidy/cppcoreguidelines/OwningMemoryCheck.cpp
+++ b/clang-tools-extra/clang-tidy/cppcoreguidelines/OwningMemoryCheck.cpp
@@ -192,6 +192,7 @@ void OwningMemoryCheck::check(const MatchFinder::MatchResult &Result) {
   CheckExecuted |= handleReturnValues(Nodes);
   CheckExecuted |= handleOwnerMembers(Nodes);
 
+  (void)CheckExecuted;
   assert(CheckExecuted &&
          "None of the subroutines executed, logic error in matcher!");
 }


        


More information about the cfe-commits mailing list