-
-
Notifications
You must be signed in to change notification settings - Fork 231
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
spell out overload resolution #292
Comments
Hello @pseyfert, thank you for bringing this up, again. Your specific example actually revealed an issue in C++ Insights. There is a function H foo()
{
return H{static_cast<const char *>("hai"), 4, static_cast<double *>(0)};
} This matches your version, just that the I also see a value in adding the explicit chosen overload signature. However, known that it is in fact an overloaded call and where to place the signature is hard. That's why I prefer the option of showing more casts. Which makes it also more insightful and correct. If this is what would help you, I'm ready to push the fix. Andreas |
Hi Andreas, your suggestion and reasoning sound good to me. Thanks, |
information. Some implicit conversions have been hidden from the start. As this issue lays out, this is suboptimal for some of them. This change enabled more conversion that turn up if `--show-all-implicit-casts` is enabled.
Fixed #292: Show more hidden conversions to improve overload resolution information.
(triggered by this SO question)
I have noticed that while I was successful using cppinsights to look up what overload resolution a compiler picks on free standing functions example this does only work when implicit casts are involved. In a minimalized version of the above SO question here I see no cast that turns
0
todouble*
.Artificially adding local variables (attempt) doesn't help spelling out the overload resolution either.
Long story short, I think it would be nice to see which overload resolution the compiler picked.
I see github detects my draft is similar to #249. I'm not sure how a printout could look. If I as a code author wanted to be explicit about which overload I want to pick, I'd probably add a comment of the intended signature
though that might be messy once composed function calls are involved
f(g(h(x)))
.Matching how I used cppinsights so far for overload resolution, the following might also be usable
The text was updated successfully, but these errors were encountered: