diff --git a/src/Buffer.h b/src/Buffer.h index 3900f986f..18810d0b2 100644 --- a/src/Buffer.h +++ b/src/Buffer.h @@ -1015,7 +1015,11 @@ inline Buffer& Buffer::operator=(Buffer&& other) noexcept { #ifndef MAGNUM_TARGET_GLES template Containers::Array inline Buffer::data() { const Int bufferSize = size(); + #ifndef CORRADE_GCC45_COMPATIBILITY CORRADE_ASSERT(bufferSize%sizeof(T) == 0, "Buffer::data(): the buffer size is" << bufferSize << "bytes, which can't be expressed as array of types with size" << sizeof(T), nullptr); + #else + CORRADE_ASSERT(bufferSize%sizeof(T) == 0, "Buffer::data(): the buffer size is" << bufferSize << "bytes, which can't be expressed as array of types with size" << sizeof(T), {}); + #endif return subData(0, bufferSize/sizeof(T)); }