[PATCH] D107961: [clang-format] Distinguish K&R C function definition and attribute

Owen Pan via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 13 04:20:08 PDT 2021


owenpan added a comment.

In D107961#2943445 <https://reviews.llvm.org/D107961#2943445>, @MyDeveloperDay wrote:

> This is better as it will catch more cases but there can still be cases we could fall foul.
>
>   Bar foo(a, Bar)
>   LLVM_OVERRIDE;
>   Bar foo(a, Bar)
>   LLVM_FINAL;
>   Bar foo(a, Bar)
>   LLVM_NOEXCEPT;
>
> Is there any way this K&R stuff can be put behind an option, I just feel like we'll be chasing shadows.

We should do it only as the last resort. Let me first give it another shot.

> I'm not making this cases up, these are examples of real cases that we've used in our cross platform environment because no all C++ compilers supported override/final.

Thanks for coming up with all these cases!


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

https://reviews.llvm.org/D107961



More information about the cfe-commits mailing list