Details
-
Bug
-
Resolution: Done
-
P2: Important
-
Qt Creator 4.1.0, Qt Creator 4.2.0-rc1
-
None
-
Win 7 64bit, Qt 5.6, Qt Creator 4.1 final and 4.2-rc1 32bit (official .exe installer from qt.io), Clang code model
Description
The situation is a QMake project where CONFIG += no_keywords is set (see attached no_keywords_bug.zip for a minimal example project). The main.cpp file includes QObject, which makes the Clang codemodel in Qt Creator 4.2-rc1 complain (see attached error1.png):
The code model could not parse an included file, which might lead to slow or incorrect codecompletion … qobject.h:424:7
The resp. line in Qt 5.6 qobject.h reads:
public Q_SLOTS:
The code model marks this line as an error and the tooltip says (see error2.png):
error. unknown type name 'slots' … expanded from macro 'Q_SLOTS'
In Creator 4.1 a Ctrl+Click on Q_SLOTS in that line jumps to the empty Q_SLOTS definition in qobjectdefs.h:71 as expected. In Creator 4.2 the same Ctrl+Click is disabled.
When I remove the "no_keywords" from the project config the problem disappears.
Qt Creator 4.1 shows the same error in qobject.h, but nothing in main.pp (since I guess those error popups are new; they’re a great feature btw).
Compilation (tried with GCC and Clang) succeeds without any warnings or errors.
Attachments
For Gerrit Dashboard: QTCREATORBUG-17371 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
181205,2 | Clang: Fix tagging of slots with CONFIG+=no_keywords | 4.2 | qt-creator/qt-creator | Status: MERGED | +2 | 0 |