danmar/cppcheck — comment on commit 2aceb623ae53d1f3a2dfa9aa118f498fcf6e6ca0
File: lib/token.cpp line 226
By reif:

You answered your own question: because it will crash if you dereference a null pointer. You'll find out real quick when you start using it.

Just add a test with a token stream and an index past the end of the token stream. This will happen with input with syntax errors.