This revision was automatically updated to reflect the committed changes.
Closed by commit rC332434: clang-format: tweak formatting of variable
initialization blocks (authored by Typz, committed by ).
Changed prior to commit:
https://reviews.llvm.org/D43290?vs=147002&id=147003#toc
Repository:
Typz updated this revision to Diff 147002.
Typz marked 6 inline comments as done.
Typz added a comment.
Address review comment & rebase
Repository:
rC Clang
https://reviews.llvm.org/D43290
Files:
lib/Format/TokenAnnotator.cpp
unittests/Format/FormatTest.cpp
Index: unittests/Format/Form
djasper accepted this revision.
djasper added a comment.
This revision is now accepted and ready to land.
Generally looks good.
Comment at: lib/Format/TokenAnnotator.cpp:2183
return 0;
+if (Left.Previous && Left.Previous->is(tok::equal) &&
+!Style.Cpp11Braced
Typz added a comment.
@djasper : ping?
Repository:
rC Clang
https://reviews.llvm.org/D43290
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Typz added a comment.
ping?
Repository:
rC Clang
https://reviews.llvm.org/D43290
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Typz added a comment.
ping?
Repository:
rC Clang
https://reviews.llvm.org/D43290
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Typz added a comment.
ping?
Repository:
rC Clang
https://reviews.llvm.org/D43290
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Typz added inline comments.
Comment at: lib/Format/TokenAnnotator.cpp:2183
return 0;
+if (Left.Previous && Left.Previous->is(tok::equal) &&
+!Style.Cpp11BracedListStyle)
djasper wrote:
> Why is this necessary?
Otherwise the `PenaltyBreakBeforeF
djasper added inline comments.
Comment at: lib/Format/TokenAnnotator.cpp:2183
return 0;
+if (Left.Previous && Left.Previous->is(tok::equal) &&
+!Style.Cpp11BracedListStyle)
Why is this necessary?
Comment at: unittests/Format/
Typz updated this revision to Diff 136081.
Typz added a comment.
Prevent breaking between = and { when Cpp11BracedListStyle=false.
Repository:
rC Clang
https://reviews.llvm.org/D43290
Files:
lib/Format/TokenAnnotator.cpp
unittests/Format/FormatTest.cpp
Index: unittests/Format/FormatTes
djasper added a comment.
In https://reviews.llvm.org/D43290#1020537, @Typz wrote:
> >> Tweaking the penalty handling would still be needed in any case, since the
> >> problem happens also when Cpp11BracedListStyle is true (though the effect
> >> is more subtle)
> >
> > I don't understand this.
Typz added a comment.
>> Tweaking the penalty handling would still be needed in any case, since the
>> problem happens also when Cpp11BracedListStyle is true (though the effect is
>> more subtle)
>
> I don't understand this. Which style do you actually care about? With
> Cpp11BracedListStyle=t
djasper added a comment.
In https://reviews.llvm.org/D43290#1008647, @Typz wrote:
> Tweaking the penalty handling would still be needed in any case, since the
> problem happens also when Cpp11BracedListStyle is true (though the effect is
> more subtle)
I don't understand this. Which style do
Typz updated this revision to Diff 134411.
Typz marked an inline comment as done.
Typz added a comment.
Address review comments.
Repository:
rC Clang
https://reviews.llvm.org/D43290
Files:
lib/Format/TokenAnnotator.cpp
unittests/Format/FormatTest.cpp
Index: unittests/Format/FormatTest.
Typz added a comment.
Tweaking the penalty handling would still be needed in any case, since the
problem happens also when Cpp11BracedListStyle is true (though the effect is
more subtle)
Generally, I think it is better to just rely on penalties, since it gives a way
to compare and weight each
djasper added a comment.
What you are doing makes sense to me. My only hesitation is whether we should
maybe completely disallow breaking between = and { when Cpp11BracedListStyle is
false instead of solving this via penalties. Specifically,
| 80 col
Typz created this revision.
Typz added reviewers: krasimir, djasper, klimek.
This patch changes the behavior of PenaltyBreakBeforeFirstCallParameter
so that is does not apply when the brace comes after an assignment.
This way, variable initialization is wrapped more like an initializer
than like
17 matches
Mail list logo