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);