3 ms·
I believe infinite recursion is also UB, but alternatively if clang converts to a tail call, it can then be converted to a loop. If the loop is infinite then yo
by olliej 7y ago
I believe infinite recursion is also UB, but alternatively if clang converts to a tail call, it can then be converted to a loop. If the loop is infinite then you’re back in UB land.
- nwellnhof 7y ago> if clang converts to a tail call, it can then be converted to a loop Yes, that's probably what happens internally. > If the loop is infinite then you’re back in UB land. I don't think so. At some point, clang forgets that the loop actually comes from a recursive function call, so it shouldn't be allowed to assume a finite loop.