do not depend on lifetime of user object in `TokenList`
TokenList depends on a mutable std::vector<std::string> object which holds the files of files which have been tokenized. This seems dangerous as it ties to the lifetime of another object. In some cases this vector is not even necessary to be owned by the user since it is not used outside of the TokenList. It looks the list this could just be owned by TokenList
This supported by the fact that the copy constructors and assignment operators copy the reference which means that two different instances will modify that "global" vector which is obviously wrong and will cause issues.
There was some usage which provides the input file via that vector parameter instead of (or additionally) to the filename parameter. This allows to tokenize multiples explicitly but I am not sure if that is even necessary. This might have contributed to the assumption that it is necessary to provide that vector.
The mess is even bigger as the vector is also referenced and (potentially) modified in Macro and preprocess().
https://trac.cppcheck.net/ticket/14268 is an issue in Cppcheck where the object went out of scope.
It appears the functionality of providing a list of existing files is required internally by Macro but not downstream in Cppcheck. I cannot really tell if that is actually necessary yet because the code is quite entangled. So far I have failed at a few attempts at doing incremental cleanups but I also do not have a final state to work back from either.