http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49418

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-06-21 
13:41:19 UTC ---
template <typename T>
void f (int const x)
{
#pragma omp parallel default(none)
  int y = x;
}

template <typename T>
void g (int const x)
{
#pragma omp parallel default(none) shared(x)
  int y = x;
}

void h ()
{
  f<int> (0);
  g<int> (0);
}

fails the same way, while after removing template <typename T> and <int>
the toplevel qualifier stays and it works as expected.
If the current C++ FE behavior is mandated by the standard, i.e. toplevel
qualifiers must be always dropped from function arguments when in templates and
not otherwise, OpenMP C++ support could just ignore TREE_READONLY on PARM_DECLs
in templates or something, but it looks very weird to me.

Reply via email to