This code compiles on gcc and msvc but not with clang from C++20 on:
#include <type_traits>
class IBase {
protected:
IBase() noexcept = default;
public:
virtual ~IBase() noexcept = default;
};
class Derived : public IBase {
public:
virtual ~Derived() noexcept(
std::is_nothrow_destructible<IBase>::value) override = default;
};
LIVE
Up to C++17 included, gcc, msvc and clang compile this code but from C++20, clang rejects it with error: exception specification is not available until end of class definition
.
Is it a clang bug or, on the contrary, a change in exception specification in C++20? How can I fix this code?
1