I just saw this: https://reviews.llvm.org/D74935
If I read it correct this is fine for us (it is, in fact, how we interpreted
noalias all along for shared references), but more eyes can't hurt. ;)
Also I am surprised they say this matches C; it's news to me that C
restrict permits read-read aliasing. I'll have to dig out the relevant part of the standard again.
I haven't thought as deeply about it but yes, my impression when I read it was also that this change blesses the way we've always used noalias for shared references (absent UnsafeCell)
I think our interpretation was already justified this way:
For further details, please see the discussion of the NoAlias response in alias analysis.
which gives an example:
when the two pointers are only ever used for reading memory.
restrict, indeed the standard says
If L is used to access the value of the object X that it designates, and X is also modified (by any means), then
Good to know, I wasn't aware read-only aliasing was allowed for