You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[SYCL] Fix cast of __ocl_sampler_t type in member initializer
Since OpenCL/OpenCLCXX doesn't permit the sample_t to be used as a
struct member, Clang lacks any implementation of member initialization
in a constructor. This results in the initializer doing an assignment
from an LValue, which causes Sema to issue a warning that binding a
reference to a stack allocated parameter (-Wdangling-field) when
attempting to initialize a member from a constructor parameter.
This warning is obviously wrong, however is a result of a malformed AST,
mostly that assigning an LValue from an LValue isn't legal. This patch
correctly inserts an LValue to RValue cast in this situation, which
prevents the warning seen in the header and should avoid an assert in
the future if one is added to later validate this behavior.
Signed-off-by: Erich Keane <[email protected]>
0 commit comments