diff --git a/src/MemoryX.h b/src/MemoryX.h index 24f301f3f..3a2b4e5cf 100644 --- a/src/MemoryX.h +++ b/src/MemoryX.h @@ -47,7 +47,9 @@ namespace std { { // Break compilation if Y* does not convert to X* // I should figure out the right use of enable_if instead - static_assert((static_cast((Y*){}), true), + // Note: YPtr avoids bogus compiler warning for C99 compound literals + using YPtr = Y*; + static_assert((static_cast(YPtr{}), true), "Pointer types not convertible"); }