Page MenuHomePhabricator

[clang-format] Improve require handling
Changes PlannedPublic

Authored by HazardyKnusperkeks on Fri, Nov 5, 2:03 PM.

Details

Summary

Before this patch the require clause between function and template declaration was written in the same line as the function. I can't believe this is what anyone wants.

Diff Detail

Event Timeline

HazardyKnusperkeks requested review of this revision.Fri, Nov 5, 2:03 PM
HazardyKnusperkeks created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptFri, Nov 5, 2:03 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript

Or am I mistaken and we want to be able to control the line break?

Also I would break before struct, class, union, but I would have needed to change the test, and I know that we at least need to talk about in in front. :)

template<typename T>
require X<T>
class ...

vs.

template<typename T>
require X<T> class ...
clang/lib/Format/TokenAnnotator.cpp
1419

This one has cost me a lot of time, should we rethink this?

I feel anything you do here would be an improvement. its probably worth looking at recent issues logged around this issue at the same time

https://bugs.llvm.org/show_bug.cgi?id=52401
https://bugs.llvm.org/show_bug.cgi?id=32165

When I added this support its was basically to prevent it from mascaraing concepts, take my implementation with a grain of salt if you think it needs changing please feel free to propose it.

MyDeveloperDay accepted this revision.Mon, Nov 8, 4:41 AM
This revision is now accepted and ready to land.Mon, Nov 8, 4:41 AM
HazardyKnusperkeks planned changes to this revision.Mon, Nov 8, 12:10 PM

I feel anything you do here would be an improvement. its probably worth looking at recent issues logged around this issue at the same time

https://bugs.llvm.org/show_bug.cgi?id=52401
https://bugs.llvm.org/show_bug.cgi?id=32165

When I added this support its was basically to prevent it from mascaraing concepts, take my implementation with a grain of salt if you think it needs changing please feel free to propose it.

I will take a look at the issues and incorporate them. I think I will add a few new options.