This is an archive of the discontinued LLVM Phabricator instance.

clang-format: Treat 'operator new' as function name.
AbandonedPublic

Authored by strager on Jun 30 2015, 10:36 PM.

Details

Reviewers
djasper
Summary

'operator new' was not being treated as a function name in
one case, so AlwaysBreakAfterDeclarationReturnType and
AlwaysBreakAfterDefinitionReturnType never triggered. This
bug affected other operators as well.

Depends on D10370.

Diff Detail

Event Timeline

strager updated this revision to Diff 28845.Jun 30 2015, 10:36 PM
strager retitled this revision from to clang-format: Treat 'operator new' as function name..
strager updated this object.
strager edited the test plan for this revision. (Show Details)
strager added reviewers: djasper, klimek.
strager added subscribers: curdeius, klimek, abdulras and 2 others.
poiru added a subscriber: poiru.Jun 30 2015, 11:11 PM
poiru added inline comments.
lib/Format/TokenAnnotator.cpp
1543

This will (incorrectly) turn code like:

A& A::operator=(const A&) {
  return *this;
}

into:

A& A::
operator=(const A&) {
  return *this;
}
strager planned changes to this revision.Jul 1 2015, 10:11 AM
strager added inline comments.
lib/Format/TokenAnnotator.cpp
1543

Cool. I'll add tests and figure something out.

klimek resigned from this revision.Jul 3 2015, 6:53 AM
klimek removed a reviewer: klimek.
poiru added a comment.EditedJul 14 2015, 12:05 AM

FYI, D11177 takes care of this.

strager abandoned this revision.Aug 7 2015, 3:44 PM