qt5base-lts/src/corelib/global
Marc Mutz 73a5ce5195 QVariant: fix HasIsNullMethod for final classes
HasIsNullMethod uses the accepted C++98 idiom to
check for members that might be inherited from
baseclasses.

The technique, however, requires inheriting from
the type-under-test, which fails for C++11 final
classes.

Fortunately, under C++11 we have much better
support for static type introspection: sfinae
for expressions. We use this here (see decltype()
use in qvariant_p.h) to write a C++11 version of
HasIsNullMethod that works with final classes, too.

However, since this technique required decltype()
support in the compiler, Q_DECL_FINAL can no longer
be used for both method and class markup. So we
declare a new Q_DECL_FINAL_CLASS which is only
set iff the compiler supports decltype(), too.

MSVC 2005 and 2008 support a non-standard, but
sufficiently compatible, version of override/final,
but no decltype(). A later patch will use MSVC
'override/'sealed' to implement Q_DECL_{OVERRIDE,FINAL}
for these compilers, but I currently don't see a
version of HasIsNullMethod that could support these
two, so the split off of Q_DECL_FINAL_CLASS is in
anticipation of that commit. If someone _does_ find
an implementation of HasIsNullMethod that works on
MSVC2005 and 2008 sealed classes, then it's a simple
matter of s/Q_DECL_FINAL_CLASS/Q_DECL_FINAL/g.

This code has been tested on GCC 4.7 (prerelease)
and GCC 4.8 (prerelease).

Change-Id: I8700c8307d79a74d45fef0aec1c6027b4a922a43
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
2012-03-08 23:58:08 +01:00
..
global.pri Move QSysInfo out of qglobal.h and into a separate header 2012-02-21 19:33:16 +01:00
qcompilerdetection.h Require compiler support for deprecated constructors. 2012-02-23 15:07:58 +01:00
qconfig-dist.h Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
qconfig-large.h Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
qconfig-medium.h Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
qconfig-minimal.h Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
qconfig-nacl.h Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
qconfig-small.h Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
qendian.h Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
qendian.qdoc Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
qfeatures.h Remove non existant features from qfeature.h 2012-01-31 04:55:33 +01:00
qfeatures.txt Remove non existant features from qfeature.h 2012-01-31 04:55:33 +01:00
qglobal.cpp Remove codecForTr(). 2012-03-06 06:34:52 +01:00
qglobal.h QVariant: fix HasIsNullMethod for final classes 2012-03-08 23:58:08 +01:00
qlibraryinfo.cpp fix relative default examples path 2012-03-06 21:50:20 +01:00
qlibraryinfo.h revamp -sysroot and -hostprefix handling 2012-03-01 23:18:23 +01:00
qlogging.cpp Remove the usage of deprecated qdoc macros. 2012-03-02 23:16:25 +01:00
qlogging.h Reshuffle code between qglobal, qlogging 2012-02-13 12:02:11 +01:00
qmalloc.cpp Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
qnamespace.h Add WindowDoesNotAcceptFocus flag and use it in xcb 2012-02-23 13:25:26 +01:00
qnamespace.qdoc Change bugreports.qt.nokia.com -> bugreports.qt-project.org 2012-03-02 23:16:25 +01:00
qnumeric_p.h Remove ARMFPA support and Q_DOUBLE_FORMAT detection 2012-03-01 16:26:55 +01:00
qnumeric.cpp Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
qnumeric.h Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
qprocessordetection.h Fixed warnings from arm builds with -Wundef 2012-03-07 00:03:18 +01:00
qsysinfo.h Move QSysInfo out of qglobal.h and into a separate header 2012-02-21 19:33:16 +01:00
qsystemdetection.h Make syncqt ignore qsystemdetection.h and qcompilerdetection.h 2012-02-07 03:40:40 +01:00
qt_pch.h Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
qt_windows.h Use Q_OS_WINCE instead of Q_WS_WINCE 2012-02-07 20:04:44 +01:00
qtypeinfo.h QtGlobal: remove qIsDetached() 2012-03-01 17:03:29 +01:00