From 3a36f3387df99ac80b2d7a190042b811180f7e75 Mon Sep 17 00:00:00 2001 From: Pier Luigi Fiorini Date: Sat, 12 Oct 2024 08:12:27 +0200 Subject: [PATCH] Fix std::as_const errors --- CMakeLists.txt | 3 +++ src/manager/session.cpp | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cb68033..ba5d257 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,6 +36,9 @@ include(ECMQmlModule) ## Disable use of C++ API deprecated in Qt 5.15 add_compile_definitions(QT_DISABLE_DEPRECATED_UP_TO=0x050F00) +## Enable -Werror by default: +add_compile_options(-Werror) + ## Shared macros and functions: if(NOT LIRI_LOCAL_ECM) find_package(LiriCMakeShared "2.0.99" REQUIRED NO_MODULE) diff --git a/src/manager/session.cpp b/src/manager/session.cpp index 2199630..2189cbd 100644 --- a/src/manager/session.cpp +++ b/src/manager/session.cpp @@ -279,7 +279,7 @@ void Session::shutdown() // Stop modules std::reverse(m_loadedModules.begin(), m_loadedModules.end()); - for (auto module : qAsConst(m_loadedModules)) { + for (auto module : std::as_const(m_loadedModules)) { auto instance = dynamic_cast(module); const auto name = m_pluginRegistry->getNameForInstance(instance);