[PATCH] D117421: [clang-format] Fix incorrect alignment of operator= overloads.

2022-01-19 Thread Marek Kurdej via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG480a1fab72f4: [clang-format] Fix incorrect alignment of operator= overloads. (authored by glotchimo, committed by curdeius). Changed prior to

[PATCH] D117421: [clang-format] Fix incorrect alignment of operator= overloads.

2022-01-18 Thread Elliott Maguire via Phabricator via cfe-commits
glotchimo added a comment. Amazing, thank you. This is my first patch so I will need help landing, but I will also apply for commit access as I intend to keep contributing. Here is my name and email for this commit: Elliott Maguire Repository: rG LLVM Github Monorepo CHANGES SINCE LAST

[PATCH] D117421: [clang-format] Fix incorrect alignment of operator= overloads.

2022-01-18 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay accepted this revision. MyDeveloperDay added a comment. I think this LGTM Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D117421/new/ https://reviews.llvm.org/D117421 ___ cfe-commits

[PATCH] D117421: [clang-format] Fix incorrect alignment of operator= overloads.

2022-01-17 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius accepted this revision. curdeius added a comment. This revision is now accepted and ready to land. LGTM. Thanks for contributing! Let's wait a day or two before landing to let other reviewers chime in. Do you need help landing? If so please provide your name and email address that

[PATCH] D117421: [clang-format] Fix incorrect alignment of operator= overloads.

2022-01-17 Thread Elliott Maguire via Phabricator via cfe-commits
glotchimo updated this revision to Diff 400696. glotchimo marked an inline comment as done. glotchimo added a comment. Simplify by removing look-ahead (unnecessary b/c of difference between ident and tokens). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D117421: [clang-format] Fix incorrect alignment of operator= overloads.

2022-01-17 Thread Elliott Maguire via Phabricator via cfe-commits
glotchimo added inline comments. Comment at: clang/lib/Format/WhitespaceManager.cpp:735-742 +if (C.Tok->Previous && C.Tok->Previous->is(tok::kw_operator)) { + FormatToken *Next = C.Tok->Next; + while (Next && Next->NewlinesBefore == 0) { +if

[PATCH] D117421: [clang-format] Fix incorrect alignment of operator= overloads.

2022-01-17 Thread Elliott Maguire via Phabricator via cfe-commits
glotchimo updated this revision to Diff 400623. glotchimo marked 4 inline comments as done. glotchimo added a comment. Use `getPreviousNonComment` to account for inline comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D117421/new/

[PATCH] D117421: [clang-format] Fix incorrect alignment of operator= overloads.

2022-01-17 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added a comment. In D117421#3249126 , @glotchimo wrote: > I was tinkering with the use of `getPreviousNonComment` last night before > signing off and the problem that I noticed was that, though it stops the > `operator=` from being split and

[PATCH] D117421: [clang-format] Fix incorrect alignment of operator= overloads.

2022-01-17 Thread Björn Schäpers via Phabricator via cfe-commits
HazardyKnusperkeks added a comment. In D117421#3249196 , @glotchimo wrote: > In D117421#3247632 , @curdeius > wrote: > >> Could you check if your patch fixes >> https://github.com/llvm/llvm-project/issues/33044

[PATCH] D117421: [clang-format] Fix incorrect alignment of operator= overloads.

2022-01-17 Thread Elliott Maguire via Phabricator via cfe-commits
glotchimo added a comment. In D117421#3247632 , @curdeius wrote: > Could you check if your patch fixes > https://github.com/llvm/llvm-project/issues/33044 as well? > If so, please add tests. As of right now, it doesn't fix 33044. Should I investigate

[PATCH] D117421: [clang-format] Fix incorrect alignment of operator= overloads.

2022-01-17 Thread Elliott Maguire via Phabricator via cfe-commits
glotchimo added a comment. I was tinkering with the use of `getPreviousNonComment` last night before signing off and the problem that I noticed was that, though it stops the `operator=` from being split and aligned with previous lines, it adds a single space: /* long long padding */ int() =

[PATCH] D117421: [clang-format] Fix incorrect alignment of operator= overloads.

2022-01-17 Thread Elliott Maguire via Phabricator via cfe-commits
glotchimo updated this revision to Diff 400606. glotchimo marked an inline comment as done. glotchimo added a comment. Add overload declaration look-ahead. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D117421/new/ https://reviews.llvm.org/D117421

[PATCH] D117421: [clang-format] Fix incorrect alignment of operator= overloads.

2022-01-17 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added inline comments. Comment at: clang/lib/Format/WhitespaceManager.cpp:735-742 +if (C.Tok->Previous && C.Tok->Previous->is(tok::kw_operator)) { + FormatToken *Next = C.Tok->Next; + while (Next && Next->NewlinesBefore == 0) { +if

[PATCH] D117421: [clang-format] Fix incorrect alignment of operator= overloads.

2022-01-17 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added inline comments. Comment at: clang/lib/Format/WhitespaceManager.cpp:735 +// Do not align operator= overloads. +if (C.Tok->Previous && C.Tok->Previous->is(tok::kw_operator)) { + FormatToken *Next = C.Tok->Next; This should

[PATCH] D117421: [clang-format] Fix incorrect alignment of operator= overloads.

2022-01-17 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added a comment. With your patch I still see the bug in this case: struct S { constexpr S(const S &) = default; void f() = default; S /**/=(S) {} }; Mind the `operator =`. It happens every time that `operator=` has only declaration (no definition

[PATCH] D117421: [clang-format] Fix incorrect alignment of operator= overloads.

2022-01-17 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay added inline comments. Comment at: clang/unittests/Format/FormatTest.cpp:16172 + "int () = default;\n" + "int =() {", + Alignment); can you add a test showing what happens when you don't have the `{` in

[PATCH] D117421: [clang-format] Fix incorrect alignment of operator= overloads.

2022-01-17 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay added a comment. In D117421#3246627 , @glotchimo wrote: > I don't know why, but `clang-format` reformatted most if not all of the > long/block comments in `WhitespaceManager.cpp`. Will it be necessary for me > to revert the changes to

[PATCH] D117421: [clang-format] Fix incorrect alignment of operator= overloads.

2022-01-17 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added a comment. Could you check if your patch fixes https://github.com/llvm/llvm-project/issues/33044 as well? If so, please add tests. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D117421/new/ https://reviews.llvm.org/D117421

[PATCH] D117421: [clang-format] Fix incorrect alignment of operator= overloads.

2022-01-17 Thread Elliott Maguire via Phabricator via cfe-commits
glotchimo updated this revision to Diff 400455. glotchimo marked an inline comment as done. glotchimo added a comment. Add equality operator tests. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D117421/new/ https://reviews.llvm.org/D117421 Files:

[PATCH] D117421: [clang-format] Fix incorrect alignment of operator= overloads.

2022-01-16 Thread Elliott Maguire via Phabricator via cfe-commits
glotchimo updated this revision to Diff 400439. glotchimo added a comment. Explicitly declare `FormatToken` type instead of using `auto`. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D117421/new/ https://reviews.llvm.org/D117421 Files:

[PATCH] D117421: [clang-format] Fix incorrect alignment of operator= overloads.

2022-01-16 Thread Björn Schäpers via Phabricator via cfe-commits
HazardyKnusperkeks added a comment. Thanks for fixing this. It hit my quite some times, but never had the time to look into it. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D117421/new/ https://reviews.llvm.org/D117421

[PATCH] D117421: [clang-format] Fix incorrect alignment of operator= overloads.

2022-01-16 Thread Elliott Maguire via Phabricator via cfe-commits
glotchimo added a comment. Excellent, thank you! I'll get right on these edits. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D117421/new/ https://reviews.llvm.org/D117421 ___ cfe-commits mailing list

[PATCH] D117421: [clang-format] Fix incorrect alignment of operator= overloads.

2022-01-16 Thread Marek Kurdej via Phabricator via cfe-commits
curdeius added a comment. Thanks for working on this! I'll have a closer look tomorrow or on Tuesday. Comment at: clang/lib/Format/WhitespaceManager.cpp:735 +// Do not align operator= overloads. +if (C.Tok->Previous && C.Tok->Previous->is(tok::kw_operator)) { +