From 3b7b7e14818a79375ee94d3d0e0ec4ec051ef3fa Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Sun, 18 Sep 2016 10:31:59 -0400 Subject: [PATCH] avoid bogus warning about C99 compound literals --- src/MemoryX.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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"); }