Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-977

Shiboken ignores the "noexcept" in wrapped function declarations

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Not Evaluated
    • 5.12.3
    • 5.12.1
    • Shiboken
    • None
    • All
    • 7539ef50f0755f89e9307d036cf4cc63bbf79e3a (pyside/pyside-setup/5.12)

    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

        Activity

          People

            kleint Friedemann Kleint
            volka Volker Aßmann
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes