diff options
author | Volker Aßmann <volker.assmann@gmail.com> | 2019-03-20 22:06:59 +0100 |
---|---|---|
committer | Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> | 2019-03-23 15:59:33 +0000 |
commit | 7539ef50f0755f89e9307d036cf4cc63bbf79e3a (patch) | |
tree | f82358027287bd2f1064180d88806fc135011055 /sources/shiboken2 | |
parent | 37b4456fd4cbba25b674a973a920e0d24060d3e4 (diff) |
Shiboken: Add "noexcept" to wrapper when wrapped function is noexcept
The clangparser was already recording the exception specifier for
wrapped functions, but the code generator did not transfer the type
specifier to the wrapper function. With modern compilers this leads
to compile errors as the exception specifier is now part of the
type. Noexcept is now added whenever the clangparser determines the
source function is noexcept.
Change-Id: I1f68981d997fcf4f007569c6d682e3dcf68eca60
Fixes: PYSIDE-977
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources/shiboken2')
-rw-r--r-- | sources/shiboken2/generator/shiboken2/shibokengenerator.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sources/shiboken2/generator/shiboken2/shibokengenerator.cpp b/sources/shiboken2/generator/shiboken2/shibokengenerator.cpp index ec0d466f7..c572a98d9 100644 --- a/sources/shiboken2/generator/shiboken2/shibokengenerator.cpp +++ b/sources/shiboken2/generator/shiboken2/shibokengenerator.cpp @@ -1491,6 +1491,9 @@ QString ShibokenGenerator::functionSignature(const AbstractMetaFunction *func, if (func->isConstant() && !(options & Generator::ExcludeMethodConst)) s << " const"; + if (func->exceptionSpecification() == ExceptionSpecification::NoExcept) + s << " noexcept"; + return result; } |