[PATCH] D141324: [clang] extend external_source_symbol attribute with the USR clause

Erich Keane via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 18 12:54:06 PST 2023


erichkeane added inline comments.


================
Comment at: clang/include/clang/Basic/AttrDocs.td:1764
+  the ``external_source_symbol`` attribute with
+  ``__has_attribute(external_source_symbol_with_usr)``.
+
----------------
arphaman wrote:
> aaron.ballman wrote:
> > erichkeane wrote:
> > > I don't think we can do this.  __has_attribute needs to take the actual name of the attribute.
> > +1
> `__has_attribute(external_source_symbol)` already works but it wouldn't help here as it doesn't tell whether the attribute supports USR or not. Are you saying I should come up with a totally new attribute that accepts USR? That was originally why I had the `__has_feature` check.
The typical way of doing this in the standard is to have __has_c_attribute/__has_cpp_attribute return a larger non-zero value for the normal attribute.

I suspect we should extend `__has_attribute` to do something similar (that is, allowing Feature Test Macros' for it).  Aaron, WDYT?


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

https://reviews.llvm.org/D141324



More information about the cfe-commits mailing list