Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-22519

Follow Symbol Under Cursor broken on _Nullable keyword

    XMLWordPrintable

Details

    • Linux/X11

    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.

      1. Hit F2 on MyClass::isValid in main.cpp and it will correctly go to main.h
      2. 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
      

      Attachments

        1. Error.png
          Error.png
          152 kB
        2. NullabilityClangBug.tar.bz2
          0.5 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            kandeler Christian Kandeler
            dark_sylinc Matias N. Goldberg
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes