Skip to content

Commit 2e3f135

Browse files
committed
Fix #669
1 parent 163fc92 commit 2e3f135

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

simplecpp.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3518,7 +3518,17 @@ void simplecpp::preprocess(simplecpp::TokenList &output, const simplecpp::TokenL
35183518
includetokenstack.push(rawtokens.cfront());
35193519
for (auto it = dui.includes.cbegin(); it != dui.includes.cend(); ++it) {
35203520
const FileData *const filedata = cache.get("", *it, dui, false, files, outputList).first;
3521-
if (filedata != nullptr && filedata->tokens.cfront() != nullptr)
3521+
if (filedata == nullptr) {
3522+
if (outputList) {
3523+
simplecpp::Output err{
3524+
simplecpp::Output::EXPLICIT_INCLUDE_NOT_FOUND,
3525+
{},
3526+
"Can not open include file '" + *it + "' that is explicitly included."
3527+
};
3528+
outputList->emplace_back(std::move(err));
3529+
}
3530+
}
3531+
else if (filedata->tokens.cfront() != nullptr)
35223532
includetokenstack.push(filedata->tokens.cfront());
35233533
}
35243534

0 commit comments

Comments
 (0)