4 ms·
Clang tail-calls aren't guaranteed to work with all C++ code. If you have a non-trivial constructor, as you mention, it will tell you this and fail instead of s
by StilesCrisis 2mo ago
Clang tail-calls aren't guaranteed to work with all C++ code. If you have a non-trivial constructor, as you mention, it will tell you this and fail instead of silently letting you believe you have tail-calls when you don't.
- fweimer 2mo agoThere are far more cases. Some ABIs use callee-saved registers for parameter-passing under certain circumstances, for example. Usually, there are compatibility restrictions on the signatures of the current and tail-called functions beyond the return type, too. This is different from Scheme or the MLs (there as a quality-of-implementation feature) where tail calls into arbitrary functions are expected not to lead to space leaks.
- StilesCrisis 2mo agoRight--if the tailing isn't possible, for any of these varied reasons, it will become a compile error.
- tialaramex 2mo agoI have to say that at least knowing if I didn't get what I wanted is most of the value for me.