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

"Follow symbol under cursor" goes to the wrong symbol when it has multiple platform-specific definitions

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • Not Evaluated
    • None
    • Qt Creator 13.0.0
    • C/C++/Obj-C++ Support
    • None
    • macOS 13.6.6, Qt Creator 13.0.0
    • macOS

    Description

      Consider a Qt project with a pro file containing the following:

      SOURCES += main.cpp
      HEADERS += funcs.h
      win32: SOURCES += funcs_win.cpp
      macx: SOURCES += funcs_mac.cpp

      The contents of funcs_win.cpp and funcs_mac.cpp are both:

      void someFunction() {
      // platform specific code here
      }

      The contents of funcs.h is:

      void someFunction();

      And the contents of main.cpp is:

      #include "funcs.h"

      int main(int argc, char *argv[]) {
      someFunction();
      return 0;
      }

      (Forgive the formatting – I can't figure out how to include formatting code in the bug reporter text editor!)

      If I open this project in Qt Creator, right click someFunction() in main.cpp, and pick "Follow symbol under cursor", in macOS it will consistently go to the someFunction() implementation in funcs_win.cpp instead of funcs_mac.cpp.

      Granted there is an ambiguity as to which implementation it could be in general, but that ambiguity should be resolved by using the current platform.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            kandeler Christian Kandeler
            guygizmo Brian Kendall
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes