Details
-
Bug
-
Resolution: Unresolved
-
Not Evaluated
-
None
-
Qt Creator 4.15.2
-
None
Description
Code example:
#define INC_HDR(hdr) <hdr>
#include INC_HDR(stdio.h)
void main() { }
Result (in code editor):
- orange underline at line 2
- when hovering over it, message "stdio.h: No such file or directory"
#include <stdio.h> certainly works fine, and the project can be built in both cases (with or w/o using INC_HDR macro).
The reason seems to be somewhere in src/libs/cplusplus/pp-engine.cpp (to be more specific, in void Preprocessor::synchronizeOutputLines() method), that appends newlines during expansion of "INC_HDR(stdio.h)" into something like "\n<\nstdio.h>". And it's the "\nstdio.h" file that cannot be found and finally causes "messageNoSuchFile" at void CppSourceProcessor::sourceNeeded() method (see src/plugins/cpptools/cppsourceprocessor.cpp).
Unfortunately, i'm not deeply familiar with things like C++ tokenization, AST and so on, so any help or advice would be very useful.