[clang] [BoundsSafety] build TypeLoc for CountAttributedType (PR #167287)

Henrik G. Olsson via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 11 13:59:09 PST 2025


================
@@ -253,20 +321,36 @@ static void EmitIncompleteCountedByPointeeNotes(Sema &S,
         << CATy->getPointeeType();
   }
 
-  // Suggest using __sized_by(_or_null) instead of __counted_by(_or_null) as
-  // __sized_by(_or_null) doesn't have the complete type restriction.
-  //
-  // We use the source range of the expression on the CountAttributedType as an
-  // approximation for the source range of the attribute. This isn't quite right
-  // but isn't easy to fix right now.
-  //
-  // TODO: Implement logic to find the relevant TypeLoc for the attribute and
-  // get the SourceRange from that (#113582).
----------------
hnrklssn wrote:

Ah I just put it in the commit, but that doesn't seem to have been enough

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


More information about the cfe-commits mailing list