Menu ▾ ▴

#527 Astyle operator overloading with const& and const&& after operator behavior wriong.

closed-fixed
bug (5)
2023-02-05
2019-05-24
CaoQi
No

constexpr const T &&operator*() const&& { return std::move(reference()); }
My function such as above, astylerc is

```
######## astyle 3.1 #########

[Brace Style Options]

--style=google

[Tab Options]

--indent=spaces=4

[Brace Modify Options]

--attach-closing-while

[Indentation Options]

--indent-col1-comments
--indent-switches
--indent-modifiers
--indent-labels
--indent-preproc-define

[Padding Options]

--pad-oper
--pad-comma
--unpad-paren
--align-pointer=name
--align-reference=name

[Formatting Options]

--add-braces
--remove-braces
--attach-return-type
--break-one-line-headers
--convert-tabs
--mode=c

[Other Options]

--lineend=linux
```

while I run astyle --options=./astylerc -n -q -r --preserve-date '.cpp' '.h' , sometimes
constexpr const T &&operator() const&& {
return std::move(reference());
}
goes to
constexpr const T &&operator
() const && {
return std::move(reference());
}
(with a blank between const and && or not)
but sometimes it goes to not change,
I am confused with this behavior, and wanna it to be more stable.

Discussion

  • André Simon

    André Simon - 2022-12-08
    • status: open --> open-accepted
    • assigned_to: André Simon
     
  • André Simon

    André Simon - 2023-02-05
    • status: open-accepted --> closed-fixed
     
  • André Simon

    André Simon - 2023-02-05

    Fixed in 3.2 beta

     

Log in to post a comment.