Skip to content

Commit ebb0e6c

Browse files
authored
[NFC] Remove dead code detected by code sanitizer. (#134385)
The code sanitizer is failing with this error: `Execution cannot reach this statement.` The execution code path would early exit at line 928 if `(Lil && Ril) = true`.
1 parent c22586a commit ebb0e6c

File tree

1 file changed

+0
-12
lines changed

1 file changed

+0
-12
lines changed

clang-tools-extra/clang-tidy/misc/RedundantExpressionCheck.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -927,18 +927,6 @@ static bool areExprsSameMacroOrLiteral(const BinaryOperator *BinOp,
927927
if (Lil && Ril)
928928
return Lil->getValue() == Ril->getValue();
929929

930-
const auto *LStrl = dyn_cast<StringLiteral>(Lhs);
931-
const auto *RStrl = dyn_cast<StringLiteral>(Rhs);
932-
if (Lil && Ril) {
933-
const llvm::StringRef L = Lexer::getSourceText(
934-
CharSourceRange::getTokenRange(LStrl->getBeginLoc()), SM,
935-
Context->getLangOpts(), 0);
936-
const llvm::StringRef R = Lexer::getSourceText(
937-
CharSourceRange::getTokenRange(RStrl->getBeginLoc()), SM,
938-
Context->getLangOpts(), 0);
939-
return L.compare(R) == 0;
940-
}
941-
942930
const auto *Lbl = dyn_cast<CXXBoolLiteralExpr>(Lhs);
943931
const auto *Rbl = dyn_cast<CXXBoolLiteralExpr>(Rhs);
944932
if (Lbl && Rbl)

0 commit comments

Comments
 (0)