Quuxplusone added inline comments.
================ Comment at: lib/Sema/SemaExpr.cpp:10950 + + // Do not diagnose binary literals. + if (ExprStr.find("0b") != llvm::StringRef::npos) ---------------- I would rather see this whole section as a three-liner: // Do not diagnose binary, octal, or hexadecimal literals. if (StringRef(LHSStr).startswith("0") || StringRef(RHSStr).startswith("0")) return; ================ Comment at: lib/Sema/SemaExpr.cpp:10963 + if (LeftSideValue == 2 && RightSideIntValue >= 0) { + std::string SuggestedExpr = "1<<" + RHSStr; + bool Overflow = false; ---------------- Here and on line 10971, I suggest whitespace around the `<<` (in the suggested expression). ================ Comment at: lib/Sema/SemaExpr.cpp:10983 + + S.Diag(Loc, diag::note_xor_used_as_pow_silence) << ("0x2 ^ " + RHSStr); + } else if (LeftSideValue == 10) { ---------------- Do you currently warn on, let's say, `2uLL ^ 7`? and if so, do we care that the suggested expression `0x2 ^ 7` has a different type? I imagine the answer to "do we care" is "no," but I thought I should ask. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D63423/new/ https://reviews.llvm.org/D63423 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits