Since the changed object (the array allocated in the first line) does not change through the lvalue expression, except for the inclusion of a restricted pointer, Rin the block where it is declared R, I think the code in your example is well defined.
If there Qwas a restricted pointer, then the example would be undefined.