Details
-
Bug
-
Resolution: Duplicate
-
P3: Somewhat important
-
Qt Creator 4.5.0-beta1, Qt Creator 4.9.2
-
MacOS High Sierra 10.13
-
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
- duplicates
-
QTCREATORBUG-11849 Refactor -> Add Definition in "xxx.cpp" doesn't add noexcept
- Closed
- relates to
-
QTCREATORBUG-19699 Refactoring: noexcept is not forwarded when Insert Virtual Functions action is used
- Closed