Details
Description
Trying to wrap parts of the stdlib, I found the code generator ignores the "noexcept" specifier in a function devlaration when generating the "Wrapper" class. I.e. wrapping an std::error_condition, the function
const char* name() const noexcept;
is wrapped with
const char* name() const override;
The missing noexcept in the wrapper causes GCC 8.2 to issue an error "looser throw specifier for '...", with C++ standard set to C+14 or C+17.
A simple fix should be to transfer the noexcept specifier from the wrapped function to the wrapper.
Update: the attached diff for sources/shiboken2/generator/shiboken2/shibokengenerator.cpp will actually fix the issue. Might be you want to add an additional Generator parameter to turn this on/off...
Attachments
For Gerrit Dashboard: PYSIDE-977 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
256508,4 | Shiboken: Add "noexcept" to wrapper when wrapped function is noexcept | 5.12 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
256526,2 | shiboken: Fix compile error when generating wrappers for "noexcept" functions | 5.12 | pyside/pyside-setup | Status: ABANDONED | 0 | 0 |