[PATCH] D133413: [clang-tidy] Fix crashes on `if consteval` in readability checks

Nathan James via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 29 23:32:54 PDT 2022


njames93 added inline comments.


================
Comment at: clang-tools-extra/clang-tidy/readability/SimplifyBooleanExprCheck.cpp:471
         auto *If = cast<IfStmt>(*First);
         if (!If->hasInitStorage() && !If->hasVarStorage()) {
           ExprAndBool ThenReturnBool =
----------------
Probably should add a check here.


================
Comment at: clang-tools-extra/clang-tidy/readability/SimplifyBooleanExprCheck.cpp:494
         auto *SubIf = dyn_cast<IfStmt>(SubStmt);
         if (SubIf && !SubIf->getElse() && !SubIf->hasInitStorage() &&
             !SubIf->hasVarStorage()) {
----------------
And here.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D133413/new/

https://reviews.llvm.org/D133413



More information about the cfe-commits mailing list