Suppose I have
struct s {
int* __restrict__ p1;
double v;
};
void foo(int* __restrict__ p2, struct s my_s) { /* ... */ }
Do the C++ compilers listed below respect the __restrict__ keywords in this case, and assume memory accesses through p2 cannot affect accesses through p1? Obviously this is compiler-dependent, since restrict is not a C++ keyword.
I'm mainly interested in the answer for gcc 4.9.x and nVIDIA CUDA 7.5's nvcc (when compiling device code of course, not when forwarding to a host compiler). An answer regarding current versions of clang, gcc and msvc++ would also be interesting.