Skip to content

Commit

Permalink
Fix issues with bad_expected SMF
Browse files Browse the repository at this point in the history
  • Loading branch information
miscco committed Jan 29, 2025
1 parent 62c6909 commit 909b077
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions libcudacxx/include/cuda/std/__expected/bad_expected_access.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,6 @@ class bad_expected_access;
template <>
class bad_expected_access<void> : public ::std::exception
{
protected:
_CCCL_HIDE_FROM_ABI bad_expected_access() noexcept = default;
_CCCL_HIDE_FROM_ABI bad_expected_access(const bad_expected_access&) = default;
_CCCL_HIDE_FROM_ABI bad_expected_access(bad_expected_access&&) = default;
_CCCL_HIDE_FROM_ABI bad_expected_access& operator=(const bad_expected_access&) = default;
_CCCL_HIDE_FROM_ABI bad_expected_access& operator=(bad_expected_access&&) = default;
_CCCL_HIDE_FROM_ABI virtual ~bad_expected_access() noexcept override = default;

public:
// The way this has been designed (by using a class template below) means that we'll already
// have a profusion of these vtables in TUs, and the dynamic linker will already have a bunch
Expand All @@ -74,10 +66,15 @@ template <class _Err>
class bad_expected_access : public bad_expected_access<void>
{
public:
explicit bad_expected_access(_Err __e)
_LIBCUDACXX_HIDE_FROM_ABI explicit bad_expected_access(_Err __e)
: __unex_(_CUDA_VSTD::move(__e))
{}

_CCCL_HIDE_FROM_ABI ~bad_expected_access() noexcept
{
__unex_.~_Err();
}

_LIBCUDACXX_HIDE_FROM_ABI _Err& error() & noexcept
{
return __unex_;
Expand Down

0 comments on commit 909b077

Please sign in to comment.