[llvm-bugs] [Bug 30377] New: broken formatting of post-fix increment when combined with noexcept

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Sep 14 01:25:35 PDT 2016


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: unassignedclangbugs at nondot.org
          Reporter: gonzalobg88 at gmail.com
                CC: djasper at google.com, klimek at google.com,
                    llvm-bugs at 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160914/e9ba935c/attachment.html>


More information about the llvm-bugs mailing list