Details
-
Bug
-
Resolution: Incomplete
-
Not Evaluated
-
Qt Creator 4.7.0
-
Arch Linux
GCC 8.2.0
Clang 6.0.1
CMake project
Description
When GCC is selected as the compiler, the code
#ifdef __cplusplus
extern "C"
{
#endif
will cause a parser error in clang-backend, causing semantic highlighting for the header to completely fail. (i.e. only preprocessor, comments, and primitives are highlighted, not user types, functions, etc.) If the compiler is switched to Clang the backend works correctly. In case it's version dependent, I'm running GCC 8.2. It appears to detect that it's C code for the header, but thinks that __cplusplus is defined.
Error encountered with GCC:
Works properly with Clang:
I'm using CMake to generate the project.
Attachments
Issue Links
- relates to
-
QTCREATORBUG-20039 Clang Code Model treats C files as C++
- Closed
-
QTCREATORBUG-21598 C headers sometimes fail with clang language model when using clang compiler
- Closed