diff --git a/.github/workflows/CI-unixish.yml b/.github/workflows/CI-unixish.yml index 68d4c867367..e37d88767ec 100644 --- a/.github/workflows/CI-unixish.yml +++ b/.github/workflows/CI-unixish.yml @@ -196,7 +196,16 @@ jobs: strategy: matrix: os: [ubuntu-22.04, macos-15] - cxxstd: [14, 17] + cxxstd: [14, 17, 20] + # FIXME: macos-15 fails to compile with C++20 + # + # /Users/runner/work/cppcheck/cppcheck/cmake.output/gui/test/projectfile/moc_testprojectfile.cpp:84:1: error: 'constinit' specifier is incompatible with C++ standards before C++20 [-Werror,-Wc++20-compat] + # 84 | Q_CONSTINIT const QMetaObject TestProjectFile::staticMetaObject = { { + # | ^ + # /opt/homebrew/opt/qt/lib/QtCore.framework/Headers/qcompilerdetection.h:1409:23: note: expanded from macro 'Q_CONSTINIT' + exclude: + - os: macos-15 + cxxstd: 20 fail-fast: false # Prefer quick result runs-on: ${{ matrix.os }} diff --git a/.github/workflows/CI-windows.yml b/.github/workflows/CI-windows.yml index 1c572a9dc3d..2b08f18bbf5 100644 --- a/.github/workflows/CI-windows.yml +++ b/.github/workflows/CI-windows.yml @@ -75,7 +75,7 @@ jobs: strategy: matrix: os: [windows-2022, windows-2025] - cxxstd: [14, 17] + cxxstd: [14, 17, 20] fail-fast: false runs-on: ${{ matrix.os }} diff --git a/gui/resultstree.cpp b/gui/resultstree.cpp index ed4cc8b0535..0c8ee2e3101 100644 --- a/gui/resultstree.cpp +++ b/gui/resultstree.cpp @@ -713,7 +713,7 @@ void ResultsTree::contextMenuEvent(QContextMenuEvent * e) { auto *action = new QAction(tr("No tag"), tagMenu); tagMenu->addAction(action); - connect(action, &QAction::triggered, [=]() { + connect(action, &QAction::triggered, [this]() { tagSelectedItems(QString()); }); } @@ -721,7 +721,7 @@ void ResultsTree::contextMenuEvent(QContextMenuEvent * e) for (const QString& tagstr : currentProject->getTags()) { auto *action = new QAction(tagstr, tagMenu); tagMenu->addAction(action); - connect(action, &QAction::triggered, [=]() { + connect(action, &QAction::triggered, [tagstr, this]() { tagSelectedItems(tagstr); }); } diff --git a/lib/pathmatch.cpp b/lib/pathmatch.cpp index b7d78f048df..5dd11e1d755 100644 --- a/lib/pathmatch.cpp +++ b/lib/pathmatch.cpp @@ -33,7 +33,7 @@ PathMatch::PathMatch(std::vector patterns, std::string basepath, Sy bool PathMatch::match(const std::string &path, Filemode mode) const { - return std::any_of(mPatterns.cbegin(), mPatterns.cend(), [=] (const std::string &pattern) { + return std::any_of(mPatterns.cbegin(), mPatterns.cend(), [&] (const std::string &pattern) { return match(pattern, path, mBasepath, mode, mSyntax); }); }