cast: test the correct type for alignment

This commit is contained in:
Danny Robson 2018-05-10 14:54:03 +10:00
parent 0eb7fdf5cd
commit 1567c4f9cc

View File

@ -167,7 +167,7 @@ namespace util::cast {
{
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wcast-align"
CHECK_MOD (reinterpret_cast<uintptr_t> (src), alignof (DstT));
CHECK_MOD (reinterpret_cast<uintptr_t> (src), alignof (std::remove_pointer_t<DstT>));
return reinterpret_cast<DstT> (src);
#pragma GCC diagnostic pop
}