HomePhabricator

[clang-format] [PR52595] clang-format does not recognize rvalue references to…

Authored by MyDeveloperDay on Thu, Nov 25, 3:04 AM.

Description

[clang-format] [PR52595] clang-format does not recognize rvalue references to array

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

missing space between T(&&) but not between T (& due to && being incorrectly thought of as UnaryOperator rather than PointerOrReference

int operator()(T (&)[N]) { return 0; }
int operator()(T(&&)[N]) { return 1; }

Existing Unit tests are changed because actually I think they are originally incorrect, and are inconsistent with the (&) cases that are 4 or 5 lines above them.

Reviewed By: curdeius

Differential Revision: https://reviews.llvm.org/D114519