================
@@ -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
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to