From a2d1cb87a01baede8bd163ea9c51077c53a87071 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Thu, 20 Sep 2012 16:21:30 +0200 Subject: QFlags: don't provide a constructor from void** Use a pointer-to-member instead of void** for Zero, the type that is used to accept only a literal 0, but not other ints, as QFlags ctor arguments. This was developed while trying to find the cause for a build failure in the qCompare specialisation after adding underlying-enum detection to QFlags, and it didn't help, but I think it's a saver alternative to void**, in particular since the ctor in question is implicit. Change-Id: I71c67b0b50e9404e4e42836d09d62663296f58af Reviewed-by: Thiago Macieira Reviewed-by: Olivier Goffart --- src/corelib/global/qflags.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/corelib/global/qflags.h') diff --git a/src/corelib/global/qflags.h b/src/corelib/global/qflags.h index df104417cd..9b263123a0 100644 --- a/src/corelib/global/qflags.h +++ b/src/corelib/global/qflags.h @@ -77,7 +77,8 @@ Q_DECL_CONSTEXPR inline QIncompatibleFlag::QIncompatibleFlag(int ai) : i(ai) {} template class QFlags { - typedef void **Zero; + struct Private; + typedef int (Private::*Zero); int i; public: typedef Enum enum_type; -- cgit v1.2.3