| 1 |
// PR libstdc++/116440 - std::tuple<std::tuple<std::any>> does not compile |
| 2 |
// { dg-do compile { target c++17 } } |
| 3 |
|
| 4 |
#include <any> |
| 5 |
#include <tuple> |
| 6 |
#include <type_traits> |
| 7 |
|
| 8 |
template <typename T> |
| 9 |
using TupleTuple = std::tuple<std::tuple<T>>; |
| 10 |
|
| 11 |
struct EmbedAny { |
| 12 |
std::any content; |
| 13 |
}; |
| 14 |
|
| 15 |
static_assert(std::is_copy_constructible<TupleTuple<EmbedAny>>::value); |
| 16 |
static_assert(std::is_move_constructible<TupleTuple<EmbedAny>>::value); |
| 17 |
|
| 18 |
static_assert(std::is_copy_constructible<TupleTuple<std::any>>::value); |
| 19 |
static_assert(std::is_move_constructible<TupleTuple<std::any>>::value); |
| 20 |
|
| 21 |
static_assert(std::is_constructible_v<std::any, TupleTuple<std::any>>); |
| 22 |
|
| 23 |
struct EmbedAnyWithZeroSizeArray { |
| 24 |
void* pad[0]; |
| 25 |
std::any content; |
| 26 |
}; |
| 27 |
|
| 28 |
static_assert(std::is_copy_constructible<TupleTuple<EmbedAnyWithZeroSizeArray>>::value); |
| 29 |
static_assert(std::is_move_constructible<TupleTuple<EmbedAnyWithZeroSizeArray>>::value); |