This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/49418] openmp default(none) in template function
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 21 Jun 2011 13:42:03 +0000
- Subject: [Bug c++/49418] openmp default(none) in template function
- Auto-submitted: auto-generated
- References: <bug-49418-4@http.gcc.gnu.org/bugzilla/>
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.