[PATCH] D63423: [Diagnostics] Diagnose misused xor as pow
Dávid Bolvanský via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Jun 17 15:21:07 PDT 2019
xbolva00 marked an inline comment as done.
xbolva00 added inline comments.
================
Comment at: lib/Sema/SemaExpr.cpp:10931
+ // Do not diagnose hexadecimal literals
+ if (ExprStr.find("0x") != llvm::StringRef::npos)
+ return;
----------------
Quuxplusone wrote:
> Can you use `starts_with` (or the LLVM equivalent) in both of these cases? It'll be faster and also more correct.
>
> Hex and binary are handled up here on line 10927, but octal is handled down on line 10955; why? Can't they be combined into one place in the code?
We cannot use starts_with here, case: 2 ^ 0b11.
Yes, I can combine it to one place.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D63423/new/
https://reviews.llvm.org/D63423
More information about the cfe-commits
mailing list