Your llex()
function is supposed to always return a value, but it does not. This is undefined behavior if control flow does not hit the return
statement. Per paragraph 6.6.3/2 of the C++11 standard:
Flowing off the end of a function is equivalent to a return with no value; this results in undefined behavior in a value-returning function.
Unless you fix this, you cannot make any assumptions on your program, nor have expectations about it.
For instance, I cannot reproduce the behavior in this fixed live example.