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

Gabriel Ravier <gabravier at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |accepts-invalid

--- Comment #1 from Gabriel Ravier <gabravier at gmail dot com> ---
Actually, the check is also too lenient. For instance, this should be rejected
since it's not a pointer at all:

template <class T> void v (T x);
#pragma omp declare variant (v<T>) match (construct={dispatch}) adjust_args
(need_device_ptr: x)
template <class T> void b (T x);

void t ()
{
  #pragma omp dispatch
  b<int> (42);
}

Yet it compiles just fine, to this:

"t()":
        sub     rsp, 8
        call    "omp_get_default_device"
        mov     edi, 42
        mov     esi, eax
        call    "omp_get_mapped_ptr"
        mov     rdi, rax
        call    "void v<int>(int)"
        add     rsp, 8
        ret

...which certainly seems like code that would be fun to run.

Reply via email to