================ @@ -16,6 +16,8 @@ void test1(struct fam_struct *ptr, int size, int idx) { *__builtin_counted_by_ref(ptr->array) = size; // ok *__builtin_counted_by_ref(&ptr->array[idx]) = size; // ok + *__builtin_counted_by_ref(&ptr->array) = size; // ok ---------------- bwendling wrote:
`*__builtin_counted_by_ref(ptr->array[idx]) = size;` doesn't work because the builtin requires a pointer to the FAM. (If you meant `&ptr->array[idx]`, that does work.) I don't have any use case for `&ptr->array` or the like. I just don't want to be overly restrictive on what's considered a valid argument to the builtin. I think I'll do a comparison with gcc's version and see what they accept. We can match them. https://github.com/llvm/llvm-project/pull/114495 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits