Skip to content

[C++4OpenCL] call to 'forward' is ambiguous when used inside lambda #57974

@biggysmith

Description

@biggysmith

Hi,

I'm getting a error: call to 'forward' is ambiguous when trying to compile a kernel that forwards variadic arguments

template<typename... T>
void func2(T&&... t){
}

kernel void test(                  
    __write_only image2d_t dst_img,
    __read_only image3d_t src_img
)                      
{     
    // call to forward is ambigous
    auto lambda = [](auto&&... arg) {
        func2(forward<decltype(arg)>(arg)...);
    };
          
    lambda(dst_img,src_img);  
} 

godbolt example here

It works in regular C++, but I think address spaces might be confusing it here in OpenCL.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions