1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-08-08 08:01:19 +02:00

avoid bogus warning about C99 compound literals

This commit is contained in:
Paul Licameli 2016-09-18 10:31:59 -04:00
parent 5d5edecca5
commit 3b7b7e1481

View File

@ -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<X*>((Y*){}), true),
// Note: YPtr avoids bogus compiler warning for C99 compound literals
using YPtr = Y*;
static_assert((static_cast<X*>(YPtr{}), true),
"Pointer types not convertible");
}