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

Refactoring does not work after function with constexpr if

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • P2: Important
    • None
    • Qt Creator 4.10.1
    • C/C++/Obj-C++ Support
    • None
    • Linux/X11

    Description

      If I define a function with a particular constexpr if (C++17), all refactoring options like Find references to symbol, F2, and renaming doesn't work for the functions declared/defined after it.

      void fn()
      {
          if constexpr (std::is_integral<int>::value)
          {
              int i;
          }
      }
      

      If I put the whole definition in a header file, it breaks all functions declared/defined after it. If I put the declaration in the header and the definition in the cpp file, it breaks all functions after the definition.

      If I comment out constexpr, everything works.

      If I comment out  int i, everything works.

      If i use  if constexpr (true), it also works.

      Attachments

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

        Activity

          People

            kosjar Nikolai Kosjar
            jonei Jon Eiesland
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes