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

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 19 12:10:48 PST 2025


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

> IOW, even if we stored both QualTypes and walked between them like you suggested, we'd still need that position-calculating logic for any `LateParsedTypeAttribute`.

I guess I'm not seeing why it's needed for any type attribute. Our existing type attributes either apply to one specific kind of type (like calling conventions which apply to function [pointer] types) or they're general so they apply to any levels of nesting (like __sptr, nullability qualifiers, etc). I don't think we have any other attributes where the nesting level matters, do we?

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


More information about the cfe-commits mailing list