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
If a struct has a defined cast operator for bool, the expected behavior would be that the struct can be used in if statements and cast to bool implicitly. This currently does not work in the following example.
struct Foo {
int x;
operator bool() {
return x < 5;
}
};
[numthreads(1, 1, 1)]
void main(uint tidx : SV_DispatchThreadId) {
Foo A = {1};
if (A)
A.x += 2;
}
Activity
jaebaek commentedon Nov 25, 2021
Thank you for reporting this issue. I will take a look.
llvm-beanz commentedon Feb 8, 2023
Pretty sure this is the cause here:
https://github.com/microsoft/DirectXShaderCompiler/blob/main/tools/clang/lib/Sema/SemaOverload.cpp#L1136
I'll circle back to this issue at some point.