aaron.ballman added a comment.

In D107292#2920637 <https://reviews.llvm.org/D107292#2920637>, @dblaikie wrote:

> Not a huge objection - but minor quandry: What's the motivation for this 
> patch? I don't know of any codebase that encourages/uses the alternative 
> tokens and I wonder if adding more usability to them is a worthwhile 
> investment in clang's codebase complexity, etc.

To me, the motivation comes from a signature like: `void foo(int and);` because 
it looks reasonable until you realize in C++ it means `void foo(int &&);` 
rather than declaring a parameter name of type `int`. What's worse, it can come 
up naturally in header files because it's a valid declaration in C if iso646.h 
is not included. So it's plausible to write the signature in a library exposing 
a C interface that changes the function signature when compiled in C++ -- this 
warning helps alert the programmer to such a situation.

I'm not aware of any popular coding guidelines that suggest using alternative 
tokens, but their use does show up in the wild.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D107292

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to