Closed tom-tan closed 2 years ago
This needs a test.
Done!
I used CPATH
rather than using --include-path
because the headers added by the latter are not treated as system headers by clang.systemPaths
.
I added a fallback for preprocessors that does not support include_next
because this directive is platform dependent, I guess.
Red CI.
I accidentally closed this issue but reopened it.
Thanks!
It is caused by the combination of system include paths and the use of
#include_next
directive in the system headers.In the example I shown in the issue, the dpp first resolves
stdint.h
to/usr/lib/llvm-10/lib/clang/10.0.0/include/stdint.h
and tries to expand it. However,#include_next <stdint.h>
directive in/usr/lib/llvm-10/lib/clang/10.0.0/include/stdint.h
accidentally includes the same header and failed to include/usr/include/stdint.h
(it is intended to be included) due to the include guard.This request fixes this issue by not to resolve the header path if it is in the system paths or specified include paths.