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

[clangd] New overload usage is not found

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • Qt Creator 7.0.0
    • C/C++/Obj-C++ Support
    • d0203a39f (master)

    Description

      When changing one function with one default parameter into two functions with zero and with one parameter, clangd only finds second one.

      Consider we have Other.h:

      #pragma once
      struct Other
      {
          static void foo(int i = 1);
      };
      

       and main.cpp:

      #include "Other.h"
      int main()
      {
          Other::foo();
          Other::foo(1);
          return 0;
      }
      

      Clangd finds both references in main.cpp for foo(), that's correct.

      Now, if we close main.cpp in creator and edit Other.h to:

      #pragma once
      struct Other
      {
          static void foo() {}
          static void foo(int i) {}
      };
      

      We expect to find one reference in main.cpp for each function.

      Actual result: clangd finds 2 references for foo(int) in main.cpp and none for foo().

      Additional info: if we keep main.cpp open, it is updated and works correctly.

      Attachments

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

        Activity

          People

            kandeler Christian Kandeler
            volodymyr_zibarov Volodymr Zibarov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes