rapidsna added a comment.

  struct V {
    int Sizes[2];
    int FAM[] __counted_by(Sizes[0]); // Thoughts?
  };

`-fbounds-safety` doesn't allow this. In our internal adoption experience, we 
haven't encountered such use cases yet. So, I think it's best to make the model 
restrictive to avoid surprises. If we were to support it, I think it should at 
least be limited to cases where the array subscript expression is known to be 
in bounds at compile time, to avoid an OOB access when the counted_by argument 
is evaluated.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D148381/new/

https://reviews.llvm.org/D148381

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to