FORBID_C_FUNCTION needs exception spec consistent with library declaration

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P4
    • 26
    • Affects Version/s: 26
    • Component/s: hotspot
    • b16

      The standard libraries for some platforms declare (most) functions noexcept (possibly using compiler-specific notation). C++17 made the exception specification part of the type of the function. As a consequence, some compilers error in some cases where the exception specifications for redeclarations differ.

      clang errors if the first declaration doesn't have an exception specification and a later one is noexcept. It doesn't complain in the reverse case. gcc seems to accept differences in either order. (That might be a gcc bug?) Visual Studio seems to reject any difference, regardless of include order.

      This means that FORBID_C_FUNCTION needs to be able to provide a declaration that matches the exception specification of the corresponding library declaration. (It's easier to just match the library always, rather than further conditionalize on whether the compiler might complain.)

            Assignee:
            Kim Barrett
            Reporter:
            Kim Barrett
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: