Change the base class of std::bad_optional_access. This is a (subtle) ABI change, and is in response to http://http://wg21.link/LWG2806, which I *expect* to be adopted in Kona. I am making this change now in anticipation, and will get it into 4.0, because (a) 4.0 is the first release with std::optional, and (b) I don't want to make an ABI-change later, when the user base should be significantly larger. Note that I didn't change std::experimental::bad_optional_access, because that's still specified to derive from std::logic_error.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@294133 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Marshall Clow
2017-02-05 20:06:38 +00:00
parent 7566869dab
commit e2261bde80
4 changed files with 13 additions and 11 deletions

View File

@@ -11,7 +11,7 @@
// <optional>
// class bad_optional_access : public logic_error
// class bad_optional_access : public exception
#include <optional>
#include <type_traits>
@@ -20,6 +20,6 @@ int main()
{
using std::bad_optional_access;
static_assert(std::is_base_of<std::logic_error, bad_optional_access>::value, "");
static_assert(std::is_convertible<bad_optional_access*, std::logic_error*>::value, "");
static_assert(std::is_base_of<std::exception, bad_optional_access>::value, "");
static_assert(std::is_convertible<bad_optional_access*, std::exception*>::value, "");
}