[PATCH] D114235: [clang] Extend ParsedAttr to allow custom handling for type attributes
Erich Keane via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Feb 24 07:22:11 PST 2022
erichkeane added a comment.
> For my purposes, it would be fine, and maybe even desirable, for the proposed annotate_type to have the same limitations as _Nonnull.
>
> Are you saying that a) this would not be acceptable for a more general-purpose attribute such as a putative annotate_type, or even that b) the behavior of _Nonnull itself is seen as undesirable and should be changed if possible?
Yes and Maybe? The non-type-modifying type attributes we have are here for compatibility with GCC/MSVC, but are, IMO, a complete mistake otherwise. The strange/obnoxious behavior of them disappearing off of something as soon as they are looked at funny makes them so non-intuitive that I see them as harmful.
Something as general as an 'annotate_type' would, IMO, need to be held to an even higher standard than our normal type attributes due to its nature. And I don't see how a type attribute with the behaviors you require as being both intuitive and working in the C++ type system.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D114235/new/
https://reviews.llvm.org/D114235
More information about the cfe-commits
mailing list