New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
clang-format Allow for short statement braces in requires clause #59412
Labels
Comments
@llvm/issue-subscribers-clang-format |
After comment template<class T>
concept meta_named_type_ = requires( T t ) {
meta_type_<T>;
is_base_of_type<EMetaTag::NamedType>( t.meta_tag );
{ t.name } -> string_;
{ t.nested_name_specifier } -> string_;
{ t.metadata } -> map_;
}; It seems like require expression is recognized as function? |
It seems like brace wrapping did not take require into consideration. I will try implementing it. |
This looks to be fixed at trunk template <class T>
concept meta_named_type_ = requires(T t) {
meta_type_<T>;
is_base_of_type<EMetaTag::NamedType>(t.meta_tag);
{ t.name } -> string_;
{ t.nested_name_specifier } -> string_;
{ t.metadata } -> map_;
}; |
This is still an issue if using the option |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
With custom brace styles to always break, there is no way to get one-line requires expressions to exist. In particular I mean the ones that constrain return type via
{ ... } -> ...;
, and I am not sure if they have a formal name.There probably should be another option for
AllowShortRequiresExpressionsOnASingleLine
or something similar.IE:
should preferably be:
.clang-format
16 config:The text was updated successfully, but these errors were encountered: