[PATCH] D159393: [clang] Fix several issues in the generated AttrHasAttributeImpl.inc

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 6 05:04:49 PDT 2023


aaron.ballman accepted this revision.
aaron.ballman added a subscriber: Endill.
aaron.ballman added a comment.
This revision is now accepted and ready to land.

LGTM, though please add a release note because there are user-facing changes regarding what the feature test macros return or what spellings are available (both of which can potentially break code, but I don't see much evidence that it will in practice).



================
Comment at: clang/test/Preprocessor/has_c_attribute.c:15-19
+// CHECK: gnu::warn_unused_result: 1
+C2x(gnu::warn_unused_result)
+
+// CHECK: clang::warn_unused_result: 0
+C2x(clang::warn_unused_result)
----------------
This matches the behavior we have today but I think it also shows a bug -- I think `clang::warn_unused_result` should be available in both C++ and C.

@Endill -- if you're still looking for a good first issue, that might be a reasonable one to tackle. The attribute currently uses `CXX11` as the spelling, it should instead use `Clang` as the spelling so the feature works in C the same as in C++.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D159393



More information about the cfe-commits mailing list