diff --git a/src/3rdparty/forkfd/forkfd_c11.h b/src/3rdparty/forkfd/forkfd_c11.h
index f3dc2b5357..2b1d3f181e 100644
--- a/src/3rdparty/forkfd/forkfd_c11.h
+++ b/src/3rdparty/forkfd/forkfd_c11.h
@@ -36,7 +36,7 @@
 #  define FFD_ATOMIC_ACQUIRE        std::memory_order_acquire
 #  define FFD_ATOMIC_RELEASE        std::memory_order_release
 // acq_rel & cst not necessary
-typedef std::atomic_int ffd_atomic_int;
+typedef std::atomic<int> ffd_atomic_int;
 #else
 #  include <stdatomic.h>
 #  define ffd_atomic_pointer(type)  _Atomic(type*)
diff --git a/src/corelib/codecs/qtextcodec.cpp b/src/corelib/codecs/qtextcodec.cpp
index 06fd88da90..a7b9bac6eb 100644
--- a/src/corelib/codecs/qtextcodec.cpp
+++ b/src/corelib/codecs/qtextcodec.cpp
@@ -107,7 +107,7 @@ class TextCodecsMutexLocker
 {
     using Lock = decltype(qt_unique_lock(std::declval<QRecursiveMutex&>()));
     // ### FIXME: this is used when textCodecsMutex already == nullptr
-    const Lock lock = qt_unique_lock(textCodecsMutex());
+    const Lock lock{qt_unique_lock(textCodecsMutex())};
 public:
     TextCodecsMutexLocker() {} // required d/t an ICC 19 bug
 };
diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp
index f0f77fe68e..cfd633b4f8 100644
--- a/src/corelib/global/qlibraryinfo.cpp
+++ b/src/corelib/global/qlibraryinfo.cpp
@@ -494,6 +494,7 @@ static QString prefixFromAppDirHelper()
 }
 #endif
 
+#if 0
 #if !defined(QT_BUILD_QMAKE) && QT_CONFIG(relocatable)
 #if !defined(QT_STATIC) && !(defined(Q_OS_DARWIN) && QT_CONFIG(framework)) \
         && (QT_CONFIG(dlopen) || defined(Q_OS_WIN))
@@ -506,6 +507,7 @@ static QString prefixFromQtCoreLibraryHelper(const QString &qtCoreLibraryPath)
     return QDir::cleanPath(prefixDir);
 }
 #endif
+#endif
 
 #if defined(Q_OS_WIN)
 #if defined(Q_OS_WINRT)
@@ -526,6 +528,7 @@ static HMODULE getWindowsModuleHandle()
 #endif // !Q_OS_WINRT
 #endif // Q_OS_WIN
 
+#if 0
 static QString getRelocatablePrefix()
 {
     QString prefixPath;
@@ -621,6 +624,7 @@ static QString getRelocatablePrefix()
     return prefixPath;
 }
 #endif
+#endif
 
 #if defined(QT_BUILD_QMAKE) && !defined(QT_BUILD_QMAKE_BOOTSTRAP)
 QString qmake_abslocation();
@@ -657,9 +661,6 @@ static const char *getPrefix(
 #  endif
     static QByteArray extPrefixPath = getExtPrefixFromHostBinDir().toLatin1();
     return extPrefixPath.constData();
-#elif QT_CONFIG(relocatable)
-    static QByteArray prefixPath = getRelocatablePrefix().toLatin1();
-    return prefixPath.constData();
 #else
     return QT_CONFIGURE_PREFIX_PATH;
 #endif
diff --git a/src/corelib/kernel/qvariant.h b/src/corelib/kernel/qvariant.h
index a4957472ec..de2a2e5b26 100644
--- a/src/corelib/kernel/qvariant.h
+++ b/src/corelib/kernel/qvariant.h
@@ -558,16 +558,16 @@ template<typename T>
 inline void QVariant::setValue(const T &avalue)
 {
     // If possible we reuse the current QVariant private.
-    const uint type = qMetaTypeId<T>();
-    if (isDetached() && (type == d.type || (type <= uint(QVariant::Char) && d.type <= uint(QVariant::Char)))) {
-        d.type = type;
+    const uint metaType = qMetaTypeId<T>();
+    if (isDetached() && (metaType == d.type || (metaType <= uint(QVariant::Char) && d.type <= uint(QVariant::Char)))) {
+        d.type = metaType;
         d.is_null = false;
         T *old = reinterpret_cast<T*>(d.is_shared ? d.data.shared->ptr : &d.data.ptr);
         if (QTypeInfo<T>::isComplex)
             old->~T();
         new (old) T(avalue); // call the copy constructor
     } else {
-        *this = QVariant(type, &avalue, QTypeInfo<T>::isPointer);
+        *this = QVariant(metaType, &avalue, QTypeInfo<T>::isPointer);
     }
 }
 
diff --git a/src/corelib/text/qstringlist.h b/src/corelib/text/qstringlist.h
index a464d443dc..11a68fe12f 100644
--- a/src/corelib/text/qstringlist.h
+++ b/src/corelib/text/qstringlist.h
@@ -118,8 +118,8 @@ public:
     inline QStringList(QList<QString> &&l) noexcept : QList<QString>(std::move(l)) { }
     inline QStringList(std::initializer_list<QString> args) : QList<QString>(args) { }
     template <typename InputIterator, QtPrivate::IfIsInputIterator<InputIterator> = true>
-    inline QStringList(InputIterator first, InputIterator last)
-        : QList<QString>(first, last) { }
+    inline QStringList(InputIterator firstIter, InputIterator lastIter)
+        : QList<QString>(firstIter, lastIter) { }
 
     QStringList &operator=(const QList<QString> &other)
     { QList<QString>::operator=(other); return *this; }
diff --git a/src/corelib/tools/qcontainertools_impl.h b/src/corelib/tools/qcontainertools_impl.h
index 3a0c4381f1..601177c047 100644
--- a/src/corelib/tools/qcontainertools_impl.h
+++ b/src/corelib/tools/qcontainertools_impl.h
@@ -83,38 +83,34 @@ void reserveIfForwardIterator(Container *c, ForwardIterator f, ForwardIterator l
     c->reserve(static_cast<typename Container::size_type>(std::distance(f, l)));
 }
 
-// for detecting expression validity
-template <typename ... T>
-using void_t = void;
-
-template <typename Iterator, typename = void_t<>>
-struct AssociativeIteratorHasKeyAndValue : std::false_type
-{
-};
-
 template <typename Iterator>
-struct AssociativeIteratorHasKeyAndValue<
-        Iterator,
-        void_t<decltype(std::declval<Iterator &>().key()),
-               decltype(std::declval<Iterator &>().value())>
-    >
-    : std::true_type
-{
-};
-
-template <typename Iterator, typename = void_t<>, typename = void_t<>>
-struct AssociativeIteratorHasFirstAndSecond : std::false_type
+struct AssociativeIteratorHasKeyAndValue
 {
+    template <typename U>
+    static constexpr bool test(U*, typename std::remove_reference<decltype(std::declval<U>().key())>::type* = nullptr, typename std::remove_reference<decltype(std::declval<U>().value())>::type* = nullptr)
+    {
+        return true;
+    }
+    static constexpr bool test(...)
+    {
+        return false;
+    }
+  static constexpr bool value = test(static_cast<Iterator*>(nullptr));
 };
 
 template <typename Iterator>
-struct AssociativeIteratorHasFirstAndSecond<
-        Iterator,
-        void_t<decltype(std::declval<Iterator &>()->first),
-               decltype(std::declval<Iterator &>()->second)>
-    >
-    : std::true_type
+struct AssociativeIteratorHasFirstAndSecond
 {
+    template <typename U>
+    static constexpr bool test(U*, typename std::remove_reference<decltype(std::declval<U>()->first)>::type* = nullptr, typename std::remove_reference<decltype(std::declval<U>()->second)>::type* = nullptr)
+    {
+        return true;
+    }
+    static constexpr bool test(...)
+    {
+        return false;
+    }
+  static constexpr bool value = test(static_cast<Iterator*>(nullptr));
 };
 
 template <typename Iterator>
diff --git a/src/corelib/tools/qlist.h b/src/corelib/tools/qlist.h
index 425ffa42a5..a355be3580 100644
--- a/src/corelib/tools/qlist.h
+++ b/src/corelib/tools/qlist.h
@@ -859,11 +859,11 @@ Q_OUTOFLINE_TEMPLATE QList<T>::~QList()
 
 template <typename T>
 template <typename InputIterator, QtPrivate::IfIsInputIterator<InputIterator>>
-QList<T>::QList(InputIterator first, InputIterator last)
+QList<T>::QList(InputIterator firstIter, InputIterator lastIter)
     : QList()
 {
-    QtPrivate::reserveIfForwardIterator(this, first, last);
-    std::copy(first, last, std::back_inserter(*this));
+    QtPrivate::reserveIfForwardIterator(this, firstIter, lastIter);
+    std::copy(firstIter, lastIter, std::back_inserter(*this));
 }
 
 template <typename T>
diff --git a/src/corelib/tools/qvarlengtharray.h b/src/corelib/tools/qvarlengtharray.h
index 6be695e317..692609c8e8 100644
--- a/src/corelib/tools/qvarlengtharray.h
+++ b/src/corelib/tools/qvarlengtharray.h
@@ -77,11 +77,11 @@ public:
     }
 
     template <typename InputIterator, QtPrivate::IfIsInputIterator<InputIterator> = true>
-    inline QVarLengthArray(InputIterator first, InputIterator last)
+    inline QVarLengthArray(InputIterator firstIter, InputIterator lastIter)
         : QVarLengthArray()
     {
-        QtPrivate::reserveIfForwardIterator(this, first, last);
-        std::copy(first, last, std::back_inserter(*this));
+        QtPrivate::reserveIfForwardIterator(this, firstIter, lastIter);
+        std::copy(firstIter, lastIter, std::back_inserter(*this));
     }
 
     inline ~QVarLengthArray() {
diff --git a/src/corelib/tools/qvector.h b/src/corelib/tools/qvector.h
index 62fbdb4a2a..73ae593ccd 100644
--- a/src/corelib/tools/qvector.h
+++ b/src/corelib/tools/qvector.h
@@ -571,11 +571,11 @@ QT_WARNING_POP
 
 template <typename T>
 template <typename InputIterator, QtPrivate::IfIsInputIterator<InputIterator>>
-QVector<T>::QVector(InputIterator first, InputIterator last)
+QVector<T>::QVector(InputIterator firstIter, InputIterator lastIter)
     : QVector()
 {
-    QtPrivate::reserveIfForwardIterator(this, first, last);
-    std::copy(first, last, std::back_inserter(*this));
+    QtPrivate::reserveIfForwardIterator(this, firstIter, lastIter);
+    std::copy(firstIter, lastIter, std::back_inserter(*this));
 }
 
 template <typename T>
diff --git a/src/gui/painting/qcolor.h b/src/gui/painting/qcolor.h
index f0d7dd23ad..d8b5916915 100644
--- a/src/gui/painting/qcolor.h
+++ b/src/gui/painting/qcolor.h
@@ -72,10 +72,10 @@ public:
     QColor(Qt::GlobalColor color) noexcept;
     Q_DECL_CONSTEXPR QColor(int r, int g, int b, int a = 255) noexcept
         : cspec(isRgbaValid(r, g, b, a) ? Rgb : Invalid),
-          ct(cspec == Rgb ? a * 0x0101 : 0,
-             cspec == Rgb ? r * 0x0101 : 0,
-             cspec == Rgb ? g * 0x0101 : 0,
-             cspec == Rgb ? b * 0x0101 : 0,
+          ct(isRgbaValid(r, g, b, a) == Rgb ? a * 0x0101 : 0,
+             isRgbaValid(r, g, b, a) == Rgb ? r * 0x0101 : 0,
+             isRgbaValid(r, g, b, a) == Rgb ? g * 0x0101 : 0,
+             isRgbaValid(r, g, b, a) == Rgb ? b * 0x0101 : 0,
              0) {}
     QColor(QRgb rgb) noexcept;
     QColor(QRgba64 rgba64) noexcept;
@@ -312,8 +312,8 @@ private:
 
 #ifdef Q_COMPILER_UNIFORM_INIT
 public: // can't give friendship to a namespace, so it needs to be public
-    Q_DECL_CONSTEXPR explicit QColor(Spec spec, ushort a1, ushort a2, ushort a3, ushort a4, ushort a5=0) noexcept
-        : cspec(spec), ct(a1, a2, a3, a4, a5) {}
+    Q_DECL_CONSTEXPR explicit QColor(Spec specVal, ushort a1, ushort a2, ushort a3, ushort a4, ushort a5=0) noexcept
+        : cspec(specVal), ct(a1, a2, a3, a4, a5) {}
 #endif // Q_COMPILER_UNIFORM_INIT
 };
 Q_DECLARE_TYPEINFO(QColor, QT_VERSION >= QT_VERSION_CHECK(6,0,0) ? Q_MOVABLE_TYPE : Q_RELOCATABLE_TYPE);
diff --git a/src/gui/painting/qcolorspace_p.h b/src/gui/painting/qcolorspace_p.h
index e7add19ed3..a2552bf063 100644
--- a/src/gui/painting/qcolorspace_p.h
+++ b/src/gui/painting/qcolorspace_p.h
@@ -93,7 +93,7 @@ public:
     QColorSpacePrivate(QColorSpace::NamedColorSpace namedColorSpace);
     QColorSpacePrivate(QColorSpace::Primaries primaries, QColorSpace::TransferFunction fun, float gamma);
     QColorSpacePrivate(const QColorSpacePrimaries &primaries, QColorSpace::TransferFunction fun, float gamma);
-    QColorSpacePrivate(const QColorSpacePrivate &other) = default;
+    QColorSpacePrivate(const QColorSpacePrivate &/*other*/) = default;
 
     // named different from get to avoid accidental detachs
     static QColorSpacePrivate *getWritable(QColorSpace &colorSpace)
diff --git a/src/gui/text/qtextformat.h b/src/gui/text/qtextformat.h
index 28da0fe344..d467595058 100644
--- a/src/gui/text/qtextformat.h
+++ b/src/gui/text/qtextformat.h
@@ -696,8 +696,8 @@ public:
     void setTabPositions(const QList<QTextOption::Tab> &tabs);
     QList<QTextOption::Tab> tabPositions() const;
 
-    inline void setMarker(MarkerType marker)
-    { setProperty(BlockMarker, int(marker)); }
+    inline void setMarker(MarkerType markerVal)
+    { setProperty(BlockMarker, int(markerVal)); }
     inline MarkerType marker() const
     { return MarkerType(intProperty(BlockMarker)); }
 
@@ -982,8 +982,8 @@ public:
     inline int headerRowCount() const
     { return intProperty(TableHeaderRowCount); }
 
-    inline void setBorderCollapse(bool borderCollapse)
-    { setProperty(TableBorderCollapse, borderCollapse); }
+    inline void setBorderCollapse(bool borderCollapseVal)
+    { setProperty(TableBorderCollapse, borderCollapseVal); }
     inline bool borderCollapse() const
     { return boolProperty(TableBorderCollapse); }
 
diff --git a/src/platformsupport/input/shared/devicehandlerlist_p.h b/src/platformsupport/input/shared/devicehandlerlist_p.h
index 97794d4d7d..bb3e09d0ec 100644
--- a/src/platformsupport/input/shared/devicehandlerlist_p.h
+++ b/src/platformsupport/input/shared/devicehandlerlist_p.h
@@ -74,8 +74,8 @@ public:
     bool remove(const QString &deviceNode)
     {
         const auto deviceNodeMatches = [&] (const Device &d) { return d.deviceNode == deviceNode; };
-        const auto it = std::find_if(v.cbegin(), v.cend(), deviceNodeMatches);
-        if (it == v.cend())
+        const auto it = std::find_if(v.begin(), v.end(), deviceNodeMatches);
+        if (it == v.end())
             return false;
         v.erase(it);
         return true;
diff --git a/src/testlib/qsignalspy.h b/src/testlib/qsignalspy.h
index dc0c58044f..6b2eeac915 100644
--- a/src/testlib/qsignalspy.h
+++ b/src/testlib/qsignalspy.h
@@ -118,13 +118,13 @@ public:
     }
 #endif // Q_CLANG_QDOC
 
-    QSignalSpy(const QObject *obj, const QMetaMethod &signal)
+    QSignalSpy(const QObject *obj, const QMetaMethod &signalToSpy)
         : m_waiting(false)
     {
-        if (isObjectValid(obj) && isSignalMetaMethodValid(signal) &&
-            connectToSignal(obj, signal.methodIndex())) {
-            sig = signal.methodSignature();
-            initArgs(signal, obj);
+        if (isObjectValid(obj) && isSignalMetaMethodValid(signalToSpy) &&
+            connectToSignal(obj, signalToSpy.methodIndex())) {
+            sig = signalToSpy.methodSignature();
+            initArgs(signalToSpy, obj);
         }
     }
 
@@ -157,11 +157,11 @@ public:
     }
 
 private:
-    bool connectToSignal(const QObject *sender, int sigIndex)
+    bool connectToSignal(const QObject *senderToConnect, int sigIndex)
     {
         static const int memberOffset = QObject::staticMetaObject.methodCount();
         const bool connected = QMetaObject::connect(
-            sender, sigIndex, this, memberOffset, Qt::DirectConnection, nullptr);
+            senderToConnect, sigIndex, this, memberOffset, Qt::DirectConnection, nullptr);
 
         if (!connected)
             qWarning("QSignalSpy: QMetaObject::connect returned false. Unable to connect.");
diff --git a/src/widgets/itemviews/qtablewidget.cpp b/src/widgets/itemviews/qtablewidget.cpp
index b1dbafa997..4ee563c569 100644
--- a/src/widgets/itemviews/qtablewidget.cpp
+++ b/src/widgets/itemviews/qtablewidget.cpp
@@ -923,8 +923,8 @@ QTableWidgetSelectionRange::QTableWidgetSelectionRange(int top, int left, int bo
     Constructs a the table selection range by copying the given \a
     other table selection range.
 */
-QTableWidgetSelectionRange::QTableWidgetSelectionRange(const QTableWidgetSelectionRange &other) = default;
-QTableWidgetSelectionRange &QTableWidgetSelectionRange::operator=(const QTableWidgetSelectionRange &other) = default;
+QTableWidgetSelectionRange::QTableWidgetSelectionRange(const QTableWidgetSelectionRange &/*other*/) = default;
+QTableWidgetSelectionRange &QTableWidgetSelectionRange::operator=(const QTableWidgetSelectionRange &/*other*/) = default;
 
 /*!
     Destroys the table selection range.
diff --git a/src/widgets/widgets/qtoolbox.cpp b/src/widgets/widgets/qtoolbox.cpp
index 4d7f543a99..9abfd5d965 100644
--- a/src/widgets/widgets/qtoolbox.cpp
+++ b/src/widgets/widgets/qtoolbox.cpp
@@ -372,7 +372,7 @@ int QToolBox::insertItem(int index, QWidget *widget, const QIcon &icon, const QS
         if (index == 0)
             setCurrentIndex(index);
     } else {
-        d->pageList.insert(d->pageList.cbegin() + index, std::move(newPage));
+        d->pageList.insert(d->pageList.begin() + index, std::move(newPage));
         d->relayout();
         if (d->currentPage) {
             QWidget *current = d->currentPage->widget;
