Qt Creator 4.8.0
gcc (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0
Something like this:
#define _GNU_SOURCE #include <math.h>
cannot be parsed by clang, causing all the remaining code to be basically un-readable because there are many errors for any libc function/types used.
The parse error is the following:
Warning: The code model could not parse an included file, which might lead to incorrect code completion and highlighting, for example.
|mathcalls.h:53:1: error: unknown type name '_Float32'|
|main.c:1:1: note: in file included from /home/fabien/projects/qtcreator-clangbug/qtcreator-clangbug/main.c:1:|
|main.c:1:10: note: in file included from /home/fabien/projects/qtcreator-clangbug/qtcreator-clangbug/main.c:1:|
|test.h:6:10: note: in file included from /home/fabien/projects/qtcreator-clangbug/qtcreator-clangbug/test.h:6:|
|math.h:440:12: note: in file included from /usr/include/math.h:440:|
Note that the code is valid and compiles fine.
The issue happens with ubuntu base gcc:
- gcc (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0
- libc6 2.27-3ubuntu1
I don't reproduce it with e.g. the android clang toolchain.
I attach a minimal project reproducing the issue.