Skip to content

Conversation

patrykstefanski
Copy link

Check assignments to count-attributed objects that are implicitly immutable. For example, assigning to a dependent count that is used in an inout pointer is not allowed, since the update won't be visible on the call-site:

 void foo(int *__counted_by(count) *out_p, int count) { *out_p = ...; count = ...; // immutable } 

rdar://161608157

(cherry picked from commit 7f73488)

…nt-attributed objects Check assignments to count-attributed objects that are implicitly immutable. For example, assigning to a dependent count that is used in an inout pointer is not allowed, since the update won't be visible on the call-site: ``` void foo(int *__counted_by(count) *out_p, int count) { *out_p = ...; count = ...; // immutable } ``` rdar://161608157 (cherry picked from commit 7f73488)
@patrykstefanski patrykstefanski self-assigned this Oct 17, 2025
@patrykstefanski patrykstefanski added the clang:bounds-safety Issue relating to the experimental -fbounds-safety feature in Clang label Oct 17, 2025
@patrykstefanski
Copy link
Author

@swift-ci test

@patrykstefanski
Copy link
Author

@swift-ci test llvm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clang:bounds-safety Issue relating to the experimental -fbounds-safety feature in Clang

1 participant