[clang] [BoundsSafety] Support bounds-safety attributes in type positions (PR #179612)

Hans Wennborg via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 16 07:14:04 PST 2026


================
@@ -19713,6 +19663,332 @@ bool Sema::EntirelyFunctionPointers(const RecordDecl *Record) {
   return llvm::all_of(Record->decls(), IsFunctionPointerOrForwardDecl);
 }
 
+static QualType handleCountedByAttrField(Sema &S, QualType T, Decl *D,
+                                         const ParsedAttr &AL) {
+  if (!AL.diagnoseLangOpts(S))
+    return QualType();
+
+  auto *FD = dyn_cast<FieldDecl>(D);
+  assert(FD);
----------------
zmodem wrote:

nit: just `FD = cast<FieldDecl>(D)`

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


More information about the cfe-commits mailing list