blob: 5a7f4a8a280f3d07c1bd88484246d270cf8f8c45 [file] [log] [blame]
// { dg-options "-Wno-deprecated-declarations" }
// { dg-do compile { target c++17 } }
// Verify that r15-3419 did not change the layout of std::any
#include <any>
namespace test {
class any {
union Storage {
constexpr Storage() : ptr(nullptr) { }
void* ptr;
std::aligned_storage<sizeof(ptr), alignof(void*)>::type buffer;
};
void (*manager)(int, const any*, void*);
Storage storage;
};
}
static_assert( sizeof(std::any) == sizeof(test::any) );
static_assert( alignof(std::any) == alignof(test::any) );