From 2e3f13504052cd2f88b2814641a2219e9964ed68 Mon Sep 17 00:00:00 2001 From: glank Date: Thu, 2 Jul 2026 15:47:11 +0200 Subject: [PATCH 1/2] Fix #669 --- simplecpp.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/simplecpp.cpp b/simplecpp.cpp index 3e572fc0..e0a34c6b 100644 --- a/simplecpp.cpp +++ b/simplecpp.cpp @@ -3518,7 +3518,17 @@ void simplecpp::preprocess(simplecpp::TokenList &output, const simplecpp::TokenL includetokenstack.push(rawtokens.cfront()); for (auto it = dui.includes.cbegin(); it != dui.includes.cend(); ++it) { const FileData *const filedata = cache.get("", *it, dui, false, files, outputList).first; - if (filedata != nullptr && filedata->tokens.cfront() != nullptr) + if (filedata == nullptr) { + if (outputList) { + simplecpp::Output err{ + simplecpp::Output::EXPLICIT_INCLUDE_NOT_FOUND, + {}, + "Can not open include file '" + *it + "' that is explicitly included." + }; + outputList->emplace_back(std::move(err)); + } + } + else if (filedata->tokens.cfront() != nullptr) includetokenstack.push(filedata->tokens.cfront()); } From 129ff08376bcf22a3c58c026e0c2f1b65c6c8256 Mon Sep 17 00:00:00 2001 From: glank Date: Thu, 2 Jul 2026 16:01:21 +0200 Subject: [PATCH 2/2] Fix clang-tidy issues --- simplecpp.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/simplecpp.cpp b/simplecpp.cpp index e0a34c6b..cba58908 100644 --- a/simplecpp.cpp +++ b/simplecpp.cpp @@ -3528,8 +3528,9 @@ void simplecpp::preprocess(simplecpp::TokenList &output, const simplecpp::TokenL outputList->emplace_back(std::move(err)); } } - else if (filedata->tokens.cfront() != nullptr) + else if (filedata->tokens.cfront() != nullptr) { includetokenstack.push(filedata->tokens.cfront()); + } } std::map> maybeUsedMacros;