[PATCH] D93626: [clang-format] PR48535 clang-format Incorrectly Removes Space After C Style Cast When Type Is Not a Pointer

Marek Kurdej via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 22 06:53:16 PST 2020


curdeius added a comment.

In D93626#2467927 <https://reviews.llvm.org/D93626#2467927>, @MyDeveloperDay wrote:

> In D93626#2467745 <https://reviews.llvm.org/D93626#2467745>, @curdeius wrote:
>
>> LGTM now. I tried to find other cases where this change may change the behaviour but couldn't. Have you tried applying to some bigger repo and see what you get? The best would be a repo with SpaceAfterCStyleCast=true.
>
> Only my own internally, which I preconverted to using this style using an older clang-format then ran with this version. This seems to be fixing more cases than creating false positives:
>
> Here are just 2 additional cases I found
>
>   int a = (int16)(a + (b << 2) + (c << 4));
>   if ((size_t)(a - b) <= c)
>
> which become
>
>   int a = (int16) (a + (b << 2) + (c << 4));
>   if ((size_t) (a - b) <= c) {

Great!


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

https://reviews.llvm.org/D93626



More information about the cfe-commits mailing list