diff options
-rw-r--r-- | src/corelib/global/qflags.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/corelib/global/qflags.h b/src/corelib/global/qflags.h index 7cf06d7e88..faacf7321c 100644 --- a/src/corelib/global/qflags.h +++ b/src/corelib/global/qflags.h @@ -77,6 +77,9 @@ Q_DECL_CONSTEXPR inline QIncompatibleFlag::QIncompatibleFlag(int ai) : i(ai) {} template<typename Enum> class QFlags { + Q_STATIC_ASSERT_X((sizeof(Enum) <= sizeof(int)), + "QFlags uses an int as storage, so an enum with underlying " + "long long would overflow. Qt 5.1 will have support for 64bit enums."); struct Private; typedef int (Private::*Zero); int i; |