diff --git a/externals/simplecpp/simplecpp.cpp b/externals/simplecpp/simplecpp.cpp index 7c05fb6c9cb..199100c779b 100644 --- a/externals/simplecpp/simplecpp.cpp +++ b/externals/simplecpp/simplecpp.cpp @@ -393,14 +393,14 @@ class StdIStream : public simplecpp::TokenList::Stream { class FileStream : public simplecpp::TokenList::Stream { public: // cppcheck-suppress uninitDerivedMemberVar - we call Stream::init() to initialize the private members - EXPLICIT FileStream(const std::string &filename) + EXPLICIT FileStream(const std::string &filename, std::vector &files) : file(fopen(filename.c_str(), "rb")) , lastCh(0) , lastStatus(0) { if (!file) { - const std::vector location; - throw simplecpp::Output(location, simplecpp::Output::FILE_NOT_FOUND, "File is missing: " + filename); + files.push_back(filename); + throw simplecpp::Output(files, simplecpp::Output::FILE_NOT_FOUND, "File is missing: " + filename); } init(); } @@ -460,7 +460,7 @@ simplecpp::TokenList::TokenList(const std::string &filename, std::vector &files, Output::Type id, const std::string & errMsg ) : type(id), location(files), msg(errMsg) {} + explicit Output(const std::vector& files, Type type, const std::string& msg) : type(type), location(files), msg(msg) {} Location location; std::string msg; };