summaryrefslogtreecommitdiffstats
path: root/src/corelib/global
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2020-11-02 13:49:36 +0100
committerGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2020-11-02 16:22:59 +0100
commitd3046cbe88c5db3e159076457ae012491c53461e (patch)
tree596bb10d07db537349d091b6faca183b1c93ceb3 /src/corelib/global
parentebfd0b14aadc8d7e1415fa6a698038dffd251cb0 (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 Pick-to: 5.15 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/corelib/global')
-rw-r--r--src/corelib/global/qglobal.h13
1 files changed, 0 insertions, 13 deletions
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index 5856ddfb01..ae20e3da75 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -1175,19 +1175,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* = nullptr)
- { return T::dynamic_cast_will_always_fail_because_rtti_is_disabled; }
-#endif
-
#ifdef Q_QDOC
// Just for documentation generation