[clang] [BoundsSafety][Sema] Allow counted_by and counted_by_or_null on pointers where the pointee type is incomplete but potentially completable (PR #106321)

Dan Liew via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 7 14:49:35 PST 2025


================
@@ -3907,6 +3923,31 @@ CountAttributedType::CountAttributedType(
     DeclSlot[i] = CoupledDecls[i];
 }
 
+StringRef CountAttributedType::getAttributeName(bool WithMacroPrefix) const {
+// TODO: This method isn't really ideal because it doesn't return the spelling
+// of the attribute that was used in the user's code. This method is used for
+// diagnostics so the fact it doesn't use the spelling of the attribute in
+// the user's code could be confusing (#113585).
+#define ENUMERATE_ATTRS(PREFIX)                                                \
----------------
delcypher wrote:

Hmm actually I think I would need support for `constexpr` `std::string` to implement this and still be able to return a `StringRef`. I think LLVM is still on c++17 so I'm not sure using a lambba is do-abe here.

https://github.com/llvm/llvm-project/pull/106321


More information about the cfe-commits mailing list