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

noexcept specifier not transfered to generated implementation

    XMLWordPrintable

    Details

      Description

      If I write this in my header file:

      void myFunction() noexcept;
      

      then right click on myFunction, choose Refactor -> Add definition in cpp file, code that is generated in cpp file is:

      void myFunction()
      {
      }

      The noexcept specifier is missing, which leads to compile error.

      It would be great to also add support for cases when entire noexcept expression is present and even in case a macro is used instead of noexcept specifier, for example:

      void * myAlloc( std::size_t len ) NOEXCEPT_EXCEPT_BADALLOC;
      

       where NOEXCEPT_EXCEPT_BADALLOC evaluates to noexcept on platforms that have full overcommit enabled (i.e. where malloc cannot return NULL, e.g. Android or iOS) and to nothing on platforms that do not have full overcommit enabled (windows and some linux distributions).

      So in this case, I would expect QtCreator to generate following code in my cpp file:

      void * myAlloc( std::size_t len ) NOEXCEPT_EXCEPT_BADALLOC
      {
      }

        Attachments

          Issue Links

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

            Activity

              People

              • Assignee:
                bubke Marco Bubke
                Reporter:
                dodoent Nenad Miksa
              • Votes:
                4 Vote for this issue
                Watchers:
                9 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Gerrit Reviews

                  There are no open Gerrit changes