https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97716

            Bug ID: 97716
           Summary: Class's `operator delete`should be implicitly
                    `noexcept`
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: arthur.j.odwyer at gmail dot com
  Target Milestone: ---

#include <cstdint>
#include <type_traits>
struct S {
    void operator delete(void*);
};

static_assert(std::is_same_v<
    decltype(S::operator delete),
    void(void*) noexcept
>);

Clang and ICC and MSVC accept this static_assert; GCC rejects.

The wording controlling this is http://eel.is/c++draft/except.spec#10 :
> A deallocation function with no explicit noexcept-specifier has a 
> non-throwing exception specification.
  • [Bug c++/97716] New: Class's... arthur.j.odwyer at gmail dot com via Gcc-bugs

Reply via email to