[llvm-bugs] [Bug 31862] New: clang-format formats unnamed rvalue reference arguments incorrectly

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Feb 3 21:45:46 PST 2017


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

            Bug ID: 31862
           Summary: clang-format formats unnamed rvalue reference
                    arguments incorrectly
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Formatter
          Assignee: unassignedclangbugs at nondot.org
          Reporter: dcheng at google.com
                CC: djasper at google.com, klimek at google.com,
                    llvm-bugs at lists.llvm.org
    Classification: Unclassified

Another bug in the past in this area:
https://llvm.org/bugs/show_bug.cgi?id=15051

Formatting with -style=Chromium, the input is:
template <class Key, class Compare>
auto flat_set<Key, Compare>::operator=(flat_set&&) -> flat_set& = default;

The output is:
template <class Key, class Compare>
auto flat_set<Key, Compare>::operator=(flat_set &&) -> flat_set& = default;

But there should be no space flat_set and &&.

Interestingly enough, if the parameter is named, like this:
template <class Key, class Compare>
auto flat_set<Key, Compare>::operator=(flat_set &&set) -> flat_set& = default;

Then it formats correctly:
template <class Key, class Compare>
auto flat_set<Key, Compare>::operator=(flat_set&& set) -> flat_set& = default;

-- 
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/20170204/c3a11fc4/attachment.html>


More information about the llvm-bugs mailing list