[clang] [lldb] [BoundsSafety] Introduce LateParsedAttrType AST placeholder type (PR #204125)
Yeoul Na via cfe-commits
cfe-commits at lists.llvm.org
Wed Jul 22 10:46:45 PDT 2026
================
@@ -1358,6 +1358,37 @@ class CountAttributedTypeLoc final
SourceRange getLocalSourceRange() const;
};
+struct LateParsedAttrLocInfo {
+ SourceLocation AttrNameLoc;
----------------
rapidsna wrote:
Argument locations are preserved inside `LateParsedTypeAttribute::CachedTokens` (via `the LateParsedTypeAttribute *` payload of the type) with their original SourceLocations, and re-emerge as proper SourceRanges on the parsed `Expr*` once late parsing runs. All argument-shape diagnostics (integer type, undeclared identifier, invalid decl kind, count-argument-must-be-integer, etc.) fire during / after late parsing when we have the parsed Expr — they don't run in the pre-resolution window.
If a case arises where we need to diagnose an argument before replaying the tokens (e.g. in case we add very early type-shape validation in the future), we can either extend LateParsedAttrLocInfo or peek into the cached-token range at that point. Do you have a specific case in mind that motivated the question?
https://github.com/llvm/llvm-project/pull/204125
More information about the cfe-commits
mailing list