Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-76702

Upgrade clang-format to v15+

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      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.

            Assignee:
            Unassigned Unassigned
            Reporter:
            yoonsoo.kim@mongodb.com Yoon Soo Kim
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: