https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64748

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Thomas Schwinge from comment #3)
> (In reply to Jakub Jelinek from comment #2)
> > ??? threadprivate?  That doesn't look even remotely similar to the deviceptr
> > clause, threadprivate in OpenMP is a declarative clause you put on variables
> > to turn them into TLS vars.
> 
> I'm sorry that I didn't correctly memorize this OpenMP construct.  So,
> considering:
> 
>     void f(int *a)
>     {
>     #pragma omp threadprivate (a)
>     }
> 
> ..., the error that GCC emits is actually correct:
> 
>     $ build-gcc/gcc/xgcc -Bbuild-gcc/gcc/ ../t.c -fopenmp
>     ../t.c: In function 'f':
>     ../t.c:3:27: error: 'a' is not a variable
>      #pragma omp threadprivate (a)
>                                ^

Of course.  You can't make a parameter threadprivate, nor you can make an
automatic variable threadprivate.

Reply via email to