Code: Select all
#pragma omp task
int x = foo();
The 3.1 specification says that for C/C++ structured block is an executable statement, but there is no such term in C/C++ specification. The "int x = foo();" looks very much like executable statement.
If the above code fragment is legal, then it should be semantically equivalent to either
Code: Select all
#pragma omp task
{ int x = foo(); }
Code: Select all
int x;
#pragma omp task
{ x = foo(); }
Please help to interpret.
Thanks,
Andrey