[clang] [BoundsSafety] Support late parsing for `counted_by` in type positions (PR #166491)

Yeoul Na via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 19 09:56:55 PST 2025


================
@@ -1161,10 +1161,13 @@ class Parser : public CodeCompletionHandler {
     IdentifierInfo *MacroII = nullptr;
     SourceLocation AttrNameLoc;
     SmallVector<Decl *, 2> Decls;
+    unsigned NestedTypeLevel;
----------------
rapidsna wrote:

This represents the pointer indirection level where the attribute applies (e.g., `int *__attr(N) *` would be level 1).

I agree the name could be clearer - maybe `PointerIndirectionLevel`?

This isn't bounds-safety specific - it's a member of `struct LateParsedAttribute`, so any late-parsed attribute on a type position can generally take advantage of it.

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


More information about the cfe-commits mailing list