Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
Qt Creator 4.9.1
Description
When extension-related keywords such as _Nullable are present, "Follow Symbol Under Cursor" will correctly go to the declaration, however it won't go to the definition.
Attached is a simple example.
- Hit F2 on MyClass::isValid in main.cpp and it will correctly go to main.h
- Hit F2 again on the declaration in main.h, and it won't go to main.cpp (bug)
In order to hit this bug, QtCreator kits must be configured to use Clang-7 as shown in the attached picture
UPDATE: Also affects default GCC Kit
This is on Ubuntu 18.04 running QtCreator 4.9.1
Clang Code Model plugin is active
WORKAROUND:
A workaround at the time being is to wrap these special keywords around macros, and avoid them to be parsed by the legacy code parser
#if __clang__ && !defined( Q_CREATOR_RUN ) #define my_nullable _Nullable #define my_nonnull _Nonnull #else #define my_nullable #define my_nonnull #endif
Alternatively:
#if defined( Q_CREATOR_RUN ) #define _Nullable #define _Nonnull #endif