diff --git a/FWCore/Framework/interface/EventSetupRecordImpl.h b/FWCore/Framework/interface/EventSetupRecordImpl.h index 561fbc37d29c2..9d725927b859b 100644 --- a/FWCore/Framework/interface/EventSetupRecordImpl.h +++ b/FWCore/Framework/interface/EventSetupRecordImpl.h @@ -167,7 +167,7 @@ namespace edm { std::shared_ptr& whyFailedFactory) const { DataKey const* dataKey = nullptr; if (iResolverIndex.value() == std::numeric_limits::max()) { - whyFailedFactory = makeESHandleExceptionFactory([=] { + whyFailedFactory = makeESHandleExceptionFactory([this] { NoProductResolverException ex(this->key(), {}); return std::make_exception_ptr(ex); }); @@ -178,7 +178,7 @@ namespace edm { iResolverIndex.value() < static_cast(keysForProxies_.size())); void const* pValue = this->getFromResolverAfterPrefetch(iResolverIndex, iTransientAccessOnly, oDesc, dataKey); if (nullptr == pValue) { - whyFailedFactory = makeESHandleExceptionFactory([=] { + whyFailedFactory = makeESHandleExceptionFactory([this, dataKey] { NoProductResolverException ex(this->key(), *dataKey); return std::make_exception_ptr(ex); }); diff --git a/FWCore/Framework/src/Principal.cc b/FWCore/Framework/src/Principal.cc index d864e61ef1d09..9b6edaa3a41e1 100644 --- a/FWCore/Framework/src/Principal.cc +++ b/FWCore/Framework/src/Principal.cc @@ -1,5 +1,8 @@ /**---------------------------------------------------------------------- ----------------------------------------------------------------------*/ +#ifdef __clang__ +#pragma GCC diagnostic ignored "-Wc++20-extensions" +#endif #include "FWCore/Framework/interface/Principal.h" @@ -581,7 +584,7 @@ namespace edm { ProductData const* result = findProductByLabel(kindOfType, typeID, inputTag, consumer, sra, mcc); if (result == nullptr) { - return BasicHandle(makeHandleExceptionFactory([=]() -> std::shared_ptr { + return BasicHandle(makeHandleExceptionFactory([=, this]() -> std::shared_ptr { return makeNotFoundException( "getByLabel", kindOfType, diff --git a/FWCore/Framework/test/stubs/ToyIntProducers.cc b/FWCore/Framework/test/stubs/ToyIntProducers.cc index 059534495729a..66012887e4f32 100644 --- a/FWCore/Framework/test/stubs/ToyIntProducers.cc +++ b/FWCore/Framework/test/stubs/ToyIntProducers.cc @@ -5,6 +5,10 @@ Toy EDProducers of Ints for testing purposes only. ----------------------------------------------------------------------*/ +#ifdef __clang__ +#pragma GCC diagnostic ignored "-Wc++20-extensions" +#endif + #include "DataFormats/Common/interface/Handle.h" #include "DataFormats/Common/interface/TriggerResults.h" #include "DataFormats/TestObjects/interface/ToyProducts.h" @@ -610,7 +614,7 @@ namespace edmtest { public: explicit ManyIntWhenRegisteredProducer(edm::ParameterSet const& p) : sourceLabel_(p.getParameter("src")) { - callWhenNewProductsRegistered([=](edm::BranchDescription const& iBranch) { + callWhenNewProductsRegistered([=, this](edm::BranchDescription const& iBranch) { if (iBranch.moduleLabel() == sourceLabel_) { if (iBranch.branchType() != edm::InEvent) { throw edm::Exception(edm::errors::UnimplementedFeature) diff --git a/FWCore/Modules/src/SwitchProducer.cc b/FWCore/Modules/src/SwitchProducer.cc index 819ca6246d124..6671aaa64d1f3 100644 --- a/FWCore/Modules/src/SwitchProducer.cc +++ b/FWCore/Modules/src/SwitchProducer.cc @@ -1,3 +1,7 @@ +#ifdef __clang__ +#pragma GCC diagnostic ignored "-Wc++20-extensions" +#endif + #include "FWCore/Framework/interface/global/EDProducer.h" #include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" @@ -24,7 +28,7 @@ namespace edm { auto const& moduleLabel = iConfig.getParameter("@module_label"); auto const& chosenLabel = iConfig.getUntrackedParameter("@chosen_case"); auto const& processName = iConfig.getUntrackedParameter("@process_name"); - callWhenNewProductsRegistered([=](edm::BranchDescription const& iBranch) { + callWhenNewProductsRegistered([=, this](edm::BranchDescription const& iBranch) { if (iBranch.moduleLabel() == chosenLabel and iBranch.processName() == processName) { if (iBranch.branchType() != InEvent) { throw Exception(errors::UnimplementedFeature) diff --git a/HeterogeneousCore/AlpakaCore/interface/alpaka/ProducerBase.h b/HeterogeneousCore/AlpakaCore/interface/alpaka/ProducerBase.h index 3671c5a8e194d..25088489ad89f 100644 --- a/HeterogeneousCore/AlpakaCore/interface/alpaka/ProducerBase.h +++ b/HeterogeneousCore/AlpakaCore/interface/alpaka/ProducerBase.h @@ -4,6 +4,7 @@ #include "DataFormats/Common/interface/DeviceProduct.h" #include "FWCore/Framework/interface/FrameworkfwdMostUsed.h" #include "FWCore/Framework/interface/moduleAbilities.h" +#include "FWCore/Framework/interface/Event.h" #include "FWCore/Utilities/interface/EDPutToken.h" #include "FWCore/Utilities/interface/Transition.h" #include "HeterogeneousCore/AlpakaCore/interface/alpaka/DeviceProductType.h" diff --git a/RecoHGCal/TICL/plugins/PatternRecognitionbyFastJet.cc b/RecoHGCal/TICL/plugins/PatternRecognitionbyFastJet.cc index 2ffa2209991f0..09814ac13556c 100644 --- a/RecoHGCal/TICL/plugins/PatternRecognitionbyFastJet.cc +++ b/RecoHGCal/TICL/plugins/PatternRecognitionbyFastJet.cc @@ -53,7 +53,7 @@ void PatternRecognitionbyFastJet::buildJetAndTracksters(std::vector static_cast(minNumLayerCluster_); }); result.resize(trackster_idx + jetsSize);