diff --git a/onnxruntime/core/session/inference_session.cc b/onnxruntime/core/session/inference_session.cc index 0243c128cea3d..2cad8f58efc93 100644 --- a/onnxruntime/core/session/inference_session.cc +++ b/onnxruntime/core/session/inference_session.cc @@ -2748,6 +2748,12 @@ common::Status InferenceSession::RunAsync(const RunOptions* run_options, #if __cplusplus >= 202002L std::function run_fn = [=, this]() { #else +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated" + std::function run_fn = [=]() { +#pragma GCC diagnostic pop +#endif std::function run_fn = [=]() { #endif Status status = Status::OK();