xgupta added inline comments.
================ Comment at: clang/lib/Sema/SemaExpr.cpp:13611-13653 if (RHS.get()->EvaluateAsInt(EVResult, Context)) { llvm::APSInt Result = EVResult.Val.getInt(); if ((getLangOpts().Bool && !RHS.get()->getType()->isBooleanType() && !RHS.get()->getExprLoc().isMacroID()) || (Result != 0 && Result != 1)) { Diag(Loc, diag::warn_logical_instead_of_bitwise) << RHS.get()->getSourceRange() << (Opc == BO_LAnd ? "&&" : "||"); ---------------- nickdesaulniers wrote: > There seems to be a lot of duplication between the two; should we move these > into a static function that's called twice? Perhaps Op1 and Op2 would be > better identifiers than LHS RHS in that case? I have tried many ways, but couldn't figure out a way to do it with function, unrelated test cases started failing. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D142609/new/ https://reviews.llvm.org/D142609 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits