-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Build
It does not seem that the current version of clang-format recognizes requires clause very well.
An example:
If I write this…
template <typename T> requires isRequestableOnTimeseries<T> std::pair<bool, NamespaceString> isTimeseries(...)
the clang-format does its thing and changes the formatting like…
template <typename T> requires isRequestableOnTimeseries<T> std::pair<bool, NamespaceString> isTimeseries(...)
Found that RequiresClausePosition option is supported since clang-format 15.0
https://clang.llvm.org/docs/ClangFormatStyleOptions.html#requiresclauseposition
One of its possible values is OwnLine which seems to be appropriate for us.
The concept is one of recommended features of C++20, it would be great to have the proper formatting support.
- is duplicated by
-
SERVER-76921 toolchain v4 clang-format unaware of C++20 `requires` clauses
- Closed