[clang-tools-extra] 07c6635 - [clang-tidy] Fix logic of assertion
Sam McCall via cfe-commits
cfe-commits at lists.llvm.org
Wed May 18 23:13:36 PDT 2022
Author: Sam McCall
Date: 2022-05-19T08:13:23+02:00
New Revision: 07c663590114a7457a747653ad447c966c0e0cd1
URL: https://github.com/llvm/llvm-project/commit/07c663590114a7457a747653ad447c966c0e0cd1
DIFF: https://github.com/llvm/llvm-project/commit/07c663590114a7457a747653ad447c966c0e0cd1.diff
LOG: [clang-tidy] Fix logic of assertion
Added:
Modified:
clang-tools-extra/clang-tidy/readability/ContainerContainsCheck.cpp
Removed:
################################################################################
diff --git a/clang-tools-extra/clang-tidy/readability/ContainerContainsCheck.cpp b/clang-tools-extra/clang-tidy/readability/ContainerContainsCheck.cpp
index 7a20480fb501c..f99251df5bf47 100644
--- a/clang-tools-extra/clang-tidy/readability/ContainerContainsCheck.cpp
+++ b/clang-tools-extra/clang-tidy/readability/ContainerContainsCheck.cpp
@@ -108,10 +108,8 @@ void ContainerContainsCheck::check(const MatchFinder::MatchResult &Result) {
Result.Nodes.getNodeAs<Expr>("positiveComparison");
const auto *NegativeComparison =
Result.Nodes.getNodeAs<Expr>("negativeComparison");
- assert(
- !PositiveComparison ||
- !NegativeComparison &&
- "only one of PositiveComparison or NegativeComparison should be set");
+ assert((!PositiveComparison || !NegativeComparison) &&
+ "only one of PositiveComparison or NegativeComparison should be set");
bool Negated = NegativeComparison != nullptr;
const auto *Comparison = Negated ? NegativeComparison : PositiveComparison;
More information about the cfe-commits
mailing list