[PATCH] D121450: [clang-format] Handle attributes before case label.

Marek Kurdej via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 22 06:44:35 PDT 2022


curdeius added a comment.

In D121450#3397861 <https://reviews.llvm.org/D121450#3397861>, @jgorbe wrote:

> Hi,
>
> We've observed that this patch introduces infinite loops in some cases. Here's a reduced test case:
>
>   export class Foo extends Bar {
>     get case(): Case {
>       return (
>           (this.Bar$has('case')) ? (this.Bar$get('case')) :
>                                    (this.case = new Case()));
>     }
>   }
>
> Saving this as `/tmp/test.ts` and running `clang-format /tmp/test.ts` loops indefinitely with this patch (I stopped it after 1m27s) and finishes instantly (0.12s) after reverting the patch locally. I'm going to go ahead and push a revert. Please let me know if you need help reproducing the problem.

Thanks for the reproducer.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D121450



More information about the cfe-commits mailing list