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

            Bug ID: 30377
           Summary: broken formatting of post-fix increment when combined
                    with noexcept
           Product: clang
           Version: trunk
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Formatter
          Assignee: unassignedclangb...@nondot.org
          Reporter: gonzalob...@gmail.com
                CC: djas...@google.com, kli...@google.com,
                    llvm-bugs@lists.llvm.org
    Classification: Unclassified

The following code doesn't get formatted properly"

struct A {
  int idx_;

  // prefix increment: fine
  constexpr A& operator++() noexcept {  
    ++idx_;
    return (*this);
  }

  // postfix increment: no space between (int) and noexcept:
  constexpr A operator++(int)noexcept {
    A tmp(*this);
    ++(*this);
    return tmp;
  }
};

As you can see there is no space between the arguments of postfix increment and
the noexcept qualifier.

I haven't tried but the same might be true for other function qualifiers
(const, override, final), for function reference qualifiers (&, const&, &&),
and other operators like --, *, ->, /, ...

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to