[clang] [clang][nullability] allow _Nonnull etc on nullable class types (PR #82705)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 13 08:27:47 PDT 2024


================
@@ -2156,9 +2156,10 @@ def TypeNonNull : TypeAttr {
   let Documentation = [TypeNonNullDocs];
 }
 
-def TypeNullable : TypeAttr {
+def TypeNullable : DeclOrTypeAttr {
   let Spellings = [CustomKeyword<"_Nullable">];
   let Documentation = [TypeNullableDocs];
+//  let Subjects = SubjectList<[CXXRecord], ErrorDiag>;
----------------
AaronBallman wrote:

Ah, I forgot we hadn't yet improved that bit. I thought `DeclOrType` would still work with the subject list for declaration attributes but the logic would still have to be added manually for types.

Let's leave this in as documentation, hopefully the checking code can be improved in the future.

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


More information about the cfe-commits mailing list