[PATCH] D141811: [clang-format] Allow trailing return types in macros

Björn Schäpers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 23 12:10:31 PST 2023


HazardyKnusperkeks added a comment.

In D141811#4070629 <https://reviews.llvm.org/D141811#4070629>, @rymiel wrote:

> In D141811#4068180 <https://reviews.llvm.org/D141811#4068180>, @HazardyKnusperkeks wrote:
>
>> I thought about `auto NAME() -> int { return 42; }`.
>>
>> `decltype(auto) a = (b) -> c;` is something else...
>
> I'm not sure how that affects this? Using `decltype(auto)` as in `decltype(auto) NAME() -> int { return 42; }` will recognize the arrow as a trailing return type, but it doesn't really matter as its invalid syntax. I tried to find valid syntax where the arrow would be seen as a trailing return type, and I did with that second example

I'd just add a test to confirm that it works as expected.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D141811/new/

https://reviews.llvm.org/D141811



More information about the cfe-commits mailing list