diff options
Diffstat (limited to 'src/corelib/tools/qarraydata.h')
-rw-r--r-- | src/corelib/tools/qarraydata.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/corelib/tools/qarraydata.h b/src/corelib/tools/qarraydata.h index 074072b987..dcd95924c1 100644 --- a/src/corelib/tools/qarraydata.h +++ b/src/corelib/tools/qarraydata.h @@ -323,8 +323,14 @@ struct QArrayDataPointerRef }()) \ /**/ +#ifdef Q_COMPILER_CONSTEXPR +#define Q_ARRAY_LITERAL_CHECK_LITERAL_TYPE(Type) Q_STATIC_ASSERT(std::is_literal_type<Type>::value) +#else +#define Q_ARRAY_LITERAL_CHECK_LITERAL_TYPE(Type) do {} while (0) +#endif + #define Q_ARRAY_LITERAL_IMPL(Type, ...) \ - Q_STATIC_ASSERT(std::is_literal_type<Type>::value); \ + Q_ARRAY_LITERAL_CHECK_LITERAL_TYPE(Type); \ \ /* Portable compile-time array size computation */ \ Q_CONSTEXPR Type data[] = { __VA_ARGS__ }; Q_UNUSED(data); \ |