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

Yeoul Na via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 16 14:41:57 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);
----------------
rapidsna wrote:

Good catch. It was mostly just copied from [lang/lib/Sema/SemaDeclAttr.cpp‎](https://github.com/llvm/llvm-project/pull/179612/changes/BASE..8f1dcc83e7aebf4c2318c9486951a2fa784fb13a#diff-2a5bdb2d9f07f8d77de51d5403d349c22978141b6de6bd87fc5e449f5ed95bec). Will fix that.

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


More information about the cfe-commits mailing list