[PATCH] D79293: [clang-format] [PR45218] Fix an issue where < and > and >> in a for loop gets incorrectly interpreted at a TemplateOpener/Closer

MyDeveloperDay via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat May 2 14:50:50 PDT 2020


MyDeveloperDay added a comment.

In D79293#2016410 <https://reviews.llvm.org/D79293#2016410>, @rmansfield wrote:

> Couple examples:
>
> void foo(int x) {
>
>   for (unsigned int i = 0; i < x >> 1; i++) { }
>
> }
>
> and
>
>   int i = 0; 
>   
>   if (i < x >> 1) {}
>   
>
> }


I don't deny there are places where this will fail, but that is clang-format all over its a series of rules or the arrangement of token to produce the desired result

I think we also have to say.. "who writes code like this"  ;-)


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

https://reviews.llvm.org/D79293





More information about the cfe-commits mailing list