@@ -721,9 +721,10 @@ void SimplifyBooleanExprCheck::replaceWithThenStatement(
721721 const ASTContext &Context, const IfStmt *IfStatement,
722722 const Expr *BoolLiteral) {
723723 // Added .str() below
724- std::string Replacement = getText (Context, *IfStatement->getThen ()).str ();
724+ std::string Replacement = getText (Context, *IfStatement->getThen ()).str ();
725725 if (const Stmt *Init = IfStatement->getInit ()) {
726- Replacement = (Twine (" { " ) + getText (Context, *Init) + Replacement + " }" ).str ();
726+ Replacement =
727+ (Twine (" { " ) + getText (Context, *Init) + Replacement + " }" ).str ();
727728 }
728729 issueDiag (Context, BoolLiteral->getBeginLoc (), SimplifyConditionDiagnostic,
729730 IfStatement->getSourceRange (), Replacement);
@@ -734,14 +735,18 @@ void SimplifyBooleanExprCheck::replaceWithElseStatement(
734735 const Expr *BoolLiteral) {
735736 const Stmt *ElseStatement = IfStatement->getElse ();
736737 // Added .str() below
737- std::string Replacement = ElseStatement ? getText (Context, *ElseStatement).str () : " " ;
738+ std::string Replacement =
739+ ElseStatement ? getText (Context, *ElseStatement).str () : " " ;
738740 if (const Stmt *Init = IfStatement->getInit ()) {
739- Replacement = (Twine (" { " ) + getText (Context, *Init) + Replacement + " }" ).str ();
741+ Replacement =
742+ (Twine (" { " ) + getText (Context, *Init) + Replacement + " }" ).str ();
740743 }
741744 issueDiag (Context, BoolLiteral->getBeginLoc (), SimplifyConditionDiagnostic,
742745 IfStatement->getSourceRange (), Replacement);
743746}
744747
748+
749+
745750void SimplifyBooleanExprCheck::replaceWithCondition (
746751 const ASTContext &Context, const ConditionalOperator *Ternary,
747752 bool Negated) {
0 commit comments