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

noexcept specifier not transfered to generated implementation

    XMLWordPrintable

Details

    • 54fefd89b86f9b7c3496317bcfcf3882ff72e67c

    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

              bubke Marco Bubke
              dodoent Nenad Miksa
              Votes:
              5 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes