Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
achabense committed Sep 6, 2023
1 parent f90311d commit e6edb3c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion stl/inc/expected
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ public:
}

// clang-format off
~expected() requires is_trivially_destructible_v<_Ty>&& is_trivially_destructible_v<_Err> = default;
~expected() requires is_trivially_destructible_v<_Ty> && is_trivially_destructible_v<_Err> = default;
// clang-format on

// [expected.object.assign]
Expand Down
7 changes: 7 additions & 0 deletions tests/std/tests/P0323R12_expected/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#define _CONTAINER_DEBUG_LEVEL 1

#include <any>
#include <cassert>
#include <concepts>
#include <exception>
Expand Down Expand Up @@ -2135,6 +2136,11 @@ void test_lwg_3843() {
}
}

void test_gh_4011() {
static_assert(semiregular<expected<any, int>>);
static_assert(semiregular<expected<void, any>>);
}

int main() {
test_unexpected::test_all();
static_assert(test_unexpected::test_all());
Expand All @@ -2151,4 +2157,5 @@ int main() {

test_reinit_regression();
test_lwg_3843();
test_gh_4011();
}

0 comments on commit e6edb3c

Please sign in to comment.