diff --git a/doc/hotspot-style.html b/doc/hotspot-style.html index 22fd7b8167b..dafd29d6f54 100644 --- a/doc/hotspot-style.html +++ b/doc/hotspot-style.html @@ -87,6 +87,7 @@ id="toc-local-function-objects">Local Function Objects
  • Inheriting constructors
  • Attributes
  • +
  • noexcept
  • Additional Permitted Features
  • @@ -1140,6 +1141,58 @@ function name and the parameter list. memory_order_consume.
  • [[deprecated]] - Not relevant in HotSpot code.
  • +

    noexcept

    +

    Use of noexcept exception specifications (n3050) are permitted with restrictions +described below.

    + +

    HotSpot is built with exceptions disabled, e.g. compile with +-fno-exceptions (gcc, clang) or no /EH option +(MSVC++). So why do we need to consider noexcept at all? +It's because noexcept exception specifications serve two +distinct purposes.

    +

    The first is to allow the compiler to avoid generating code or data +in support of exceptions being thrown by a function. But this is +unnecessary, because exceptions are disabled.

    +

    The second is to allow the compiler and library code to choose +different algorithms, depending on whether some function may throw +exceptions. This is only relevant to a certain set of functions.

    + +

    HotSpot code can assume no exceptions will ever be thrown, even from +functions not declared noexcept. So HotSpot code doesn't +ever need to check, either with conditional exception specifications or +with noexcept expressions.

    +

    Dynamic exception specifications were deprecated in C++11. C++17 +removed all but throw(), with that remaining a deprecated +equivalent to noexcept.

    Additional Permitted Features