mirror of
https://github.com/cookiengineer/audacity
synced 2025-08-08 16:11:14 +02:00
avoid bogus warning about C99 compound literals
This commit is contained in:
parent
5d5edecca5
commit
3b7b7e1481
@ -47,7 +47,9 @@ namespace std {
|
|||||||
{
|
{
|
||||||
// Break compilation if Y* does not convert to X*
|
// Break compilation if Y* does not convert to X*
|
||||||
// I should figure out the right use of enable_if instead
|
// 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");
|
"Pointer types not convertible");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user