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 @@ -586,6 +586,11 @@ Changes in existing checks
586586 <clang-tidy/checks/readability/redundant-casting>` check by fixing false
587587 negatives when explicitly cast from function pointer.
588588
589+ - Improved :doc: `readability-simplify-boolean-expr
590+ <clang-tidy/checks/readability/simplify-boolean-expr>` check to avoid
591+ invalid code generation when the condition contains an initialization
592+ statement.
593+
589594- Improved :doc: `readability-uppercase-literal-suffix
590595 <clang-tidy/checks/readability/uppercase-literal-suffix>` check to recognize
591596 literal suffixes added in C++23 and C23.
You can’t perform that action at this time.
0 commit comments