From the 2.7.2 text it isn't obvious to me where exactly in the C/C++ grammar should #pragma omp declare simd be specified or what should happen if it is a function declaration with multiple declared functions.
What is supposed to happen for
#pragma omp declare simd
int foo (int), bar (), baz (double);
? Shall it be handled as if there were 3 separate function declarations, with 3 #pragma omp declare simd directives before each?
What about:
#pragma omp declare simd
int foo (int), var;
? Shall this be an error?
And, for function templates, shall #pragma omp declare simd go after template <...> or before it?
template <int N>
#pragma omp declare simd
int foo (int);
or
#pragma omp declare simd
template <int N>
int foo (int);
?
I also wonder about the: "The function declaration or definition shall not have an exception specification." restriction, does that mean that even
#pragma omp declare simd
int foo (int) throw ();
or
#pragma omp declare simd
double bar () noexcept (true);
or
#pragma omp declare simd
int baz () noexcept;
are not allowed? Is that desirable?
And, as has been raised before, I think it is undesirable to restrict just a single simdlen directive, often it is desirable to have one function compiled for more than one simdlen (e.g. one version that would use 128-bit vectors, one that would use 256-bit vectors, etc.). Then some callers could use just the 128-bit vector variant, if used in SIMD loops with lower safelen in one place and in SIMD loops with higher safelen in another place (or in say -msse4 vs. -mavx2 compiled code).
