-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows compilation of RetryStateImpl::shouldHedgeRetryPerTryTimeout impl fails #7736
Comments
@wrowe FWIW, I would just submit PRs to fix any Windows compile issues as I'm pretty sure you are the only person compiling on Windows. :) |
Thanks @mattklein123, those that we can resolve we will escalate strait to a PR. Why this compilation is failing is a mystery to me, so far. Looking for extra C++ savvy eyeballs. |
Ping; still looking for a c++ guru to suggest how Win32 CL.exe fails to interpret this correctly. |
Given
It seems that we're passing a lamba to a function that takes a bool. And I guess gcc and clang implicitly convert it and MSVC doesn't? Seems like the line should just be |
I agree with @zuercher, we should just be passing #include <iostream>
void foo(bool b) {
std::cout << b << std::endl;
}
int main(int argc, char** argv) {
foo([]() -> bool { return false; });
} With clang, this prints |
I'm going to go ahead and submit a PR to fix this, since it makes me anxious, even if it works. |
Per envoyproxy#7736, we're inadvertently casting a lambda expression to bool. Fortunately, the code is attempting to pass true, so it works. Risk Level: low Testing: n/a Docs Changes: n/a Release Notes: n/a Fixes: envoyproxy#7736 Signed-off-by: Stephan Zuercher <zuercher@gmail.com>
Windows compilation using MSBuild 15.9, we cannot get this simple line of code, introduced two months ago, to compile;
envoy/source/common/router/retry_state_impl.cc
Line 228 in afb2370
source/common/router/retry_state_impl.cc(228): error C2664: 'Envoy::Router::RetryStatus Envoy::Router::RetryStateImpl::shouldRetry(bool,Envoy::Router::RetryState::DoRetryCallback)': cannot convert argument 1 from 'Envoy::Router::RetryStateImpl::shouldHedgeRetryPerTryTimeout::<lambda_f5b81d16bf43f4b112188693c10b6098>' to 'bool'
source/common/router/retry_state_impl.cc(228): note: Ambiguous user-defined-conversion
The text was updated successfully, but these errors were encountered: