[cfe-dev] clang-format indents template methods with ref-qualification + noexcept wrongly.

Han Wang via cfe-dev cfe-dev at lists.llvm.org
Wed Oct 5 07:45:21 PDT 2016


Hi,

Let's say we have a simple template method with ref-qualification and
noexcept.

struct A {
  template <typename T>
  void foo(T&& t) & noexcept {
    DoSomething();
    DoSomethingElse();
  }
}

If we use clang-format to re-format the code with google style (or llvm or
other styles), we get

struct A {
  template <typename T>
      void foo(T&& t) & noexcept {
    DoSomething();
    DoSomethingElse();
  }
}

If we remove the noexcept or if we put a const before ref-qualification the
reformat will work correctly.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20161005/767b4a45/attachment.html>


More information about the cfe-dev mailing list