diff options
author | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2020-11-02 13:49:36 +0100 |
---|---|---|
committer | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2020-11-02 22:37:22 +0000 |
commit | c9c981468d2a8acb47399dc8e08231ee21148855 (patch) | |
tree | 66ec4dd806f03577317cd7b49f2b28f430ed1db7 /src/corelib/global/qglobal.h | |
parent | 871d74ff77b260ce37782d5f8269d8dcf5213236 (diff) |
Do not #define dynamic_cast
It's illegal. [macro.names]/2:
"A translation unit shall not #define or #undef names lexically
identical to keywords"
If someone tries to use dynamic_cast in a no-rtti scenario, let's
just have the compiler yell at them for that.
Change-Id: I70a7b55a93d34c433e874d379acae8b256620f80
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
(cherry picked from commit d3046cbe88c5db3e159076457ae012491c53461e)
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/corelib/global/qglobal.h')
-rw-r--r-- | src/corelib/global/qglobal.h | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 501c542157..7aa856a65d 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -1180,19 +1180,6 @@ Q_CORE_EXPORT QString qtTrId(const char *id, int n = -1); #endif // QT_NO_TRANSLATION -/* - When RTTI is not available, define this macro to force any uses of - dynamic_cast to cause a compile failure. -*/ - -#if defined(QT_NO_DYNAMIC_CAST) && !defined(dynamic_cast) -# define dynamic_cast QT_PREPEND_NAMESPACE(qt_dynamic_cast_check) - - template<typename T, typename X> - T qt_dynamic_cast_check(X, T* = 0) - { return T::dynamic_cast_will_always_fail_because_rtti_is_disabled; } -#endif - #ifdef Q_QDOC |