================
@@ -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
----------------
rapidsna wrote:

I guess this will just work too? `*__builtin_counted_by_ref(ptr->array[idx]) = 
size;` 

Do you have a use case? I'd prefer these being ill-formed because the user 
might find it working unexpectedly. But I don't have a strong opinion on this. 
I'd leave it up to you/Linux users if you find this would be useful.

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

Reply via email to