[PATCH] D104900: [clang-format] PR50525 doesn't handle AlignConsecutiveAssignments correctly in some situations

MyDeveloperDay via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Jun 27 06:32:39 PDT 2021


MyDeveloperDay added a comment.

In D104900#2842540 <https://reviews.llvm.org/D104900#2842540>, @darwin wrote:

> Sorry I haven't had a chance to look at this bug before it has closed. But I do have a question:
>
> I observed that this code are formatted incorrectly by the same config:
>
>   llvm::Optional<std::string> CurrentCode = None;
>   auto                        Env = std::make_unique<Environment>(Code,
>                                            FileName,
>                                            Ranges,
>                                            FirstStartColumn,
>                                            NextStartColumn,
>                                            LastStartColumn);
>
> Can this solution solve this issue? I am afraid not.
>
> If no, should I open a new bug for it?

If this is indeed a bug  you need to log its, I think it highly unlikey that its related, make sure you include your .clang-format file (and remove non impacting options)

I tested this example and it looked to work correctly (but it depends on your options I suspect):

  Language: Cpp
  BasedOnStyle: LLVM
  AlignConsecutiveDeclarations: true
  AlignConsecutiveAssignments: true
  ColumnLimit: 80



  llvm::Optional<std::string> CurrentCode = None;
  auto                        Env         = std::make_unique<Environment>(
      Code, FileName, Ranges, FirstStartColumn, NextStartColumn, LastStartColumn);


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104900



More information about the cfe-commits mailing list