File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -720,7 +720,6 @@ bool SimplifyBooleanExprCheck::issueDiag(const ASTContext &Context,
720720void SimplifyBooleanExprCheck::replaceWithThenStatement (
721721 const ASTContext &Context, const IfStmt *IfStatement,
722722 const Expr *BoolLiteral) {
723- // Added .str() below
724723 std::string Replacement = getText (Context, *IfStatement->getThen ()).str ();
725724 if (const Stmt *Init = IfStatement->getInit ()) {
726725 Replacement =
@@ -734,7 +733,6 @@ void SimplifyBooleanExprCheck::replaceWithElseStatement(
734733 const ASTContext &Context, const IfStmt *IfStatement,
735734 const Expr *BoolLiteral) {
736735 const Stmt *ElseStatement = IfStatement->getElse ();
737- // Added .str() below
738736 std::string Replacement =
739737 ElseStatement ? getText (Context, *ElseStatement).str () : " " ;
740738 if (const Stmt *Init = IfStatement->getInit ()) {
Original file line number Diff line number Diff line change @@ -616,6 +616,11 @@ Changes in existing checks
616616 where the check would sometimes suggest deleting not only a redundant
617617 ``return `` or ``continue ``, but also unrelated lines preceding it.
618618
619+ - Improved :doc: `readability-simplify-boolean-expr
620+ <clang-tidy/checks/readability/simplify-boolean-expr>` check to avoid
621+ invalid code generation when the condition contains an initialization
622+ statement.
623+
619624- Improved :doc: `readability-uppercase-literal-suffix
620625 <clang-tidy/checks/readability/uppercase-literal-suffix>` check to recognize
621626 literal suffixes added in C++23 and C23.
You can’t perform that action at this time.
0 commit comments