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

Refactoring feature: Add Definition Outside Class is not working correctly with template

    XMLWordPrintable

Details

    • Linux/X11, Windows

    Description

      Actions:

      Create class:

      class Demo{
       template <typename T, std::enable_if_t<std::is_enum_v<T>, bool> = true> 
      void print();
      }; 

      move cursor to method print(), do mouse right click and select **Refactor > Add Definition Outside Class.

      Observation: 
      Definition is generated as follow: 

      template<typename T, std::enable_if_t>
      void Demo::print()
      { 
      }
      

       

      Expectation:

      The ```<std::is_enum_v<T>, bool>``` must not be omitted in method definition

       

      template<typename T, std::enable_if_t<std::is_enum_v<T>, bool>>
      void Demo::print()
      { 
      }
      

       

       

       

      Attachments

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

        Activity

          People

            kandeler Christian Kandeler
            nocpes sepcon sepcon
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes