simplecpp icon indicating copy to clipboard operation
simplecpp copied to clipboard

`#include` pointing to directory is treated as existing empty file

Open firewave opened this issue 1 year ago • 0 comments

If an include points to an existing directory (e.g. #include </>) the code will not raise an error. I would expect it to report EXPLICIT_INCLUDE_NOT_FOUND.

This is caused by using std::ifstream::is_open() to determine the existence of a file. But if you do this on a directory it will be successful as well as the subsequent read. It will not read anything though so it behaves like an empty file.

firewave avatar Feb 22 '24 18:02 firewave