From 21ecbc95657990f78095ad7335300d562dcaa1db Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Franz=20P=C3=B6schel?= <franz.poeschel@gmail.com>
Date: Fri, 10 Nov 2023 09:42:05 +0100
Subject: [PATCH] Replace auxiliary::forget() with NOLINT comments

---
 src/IO/ADIOS/ADIOS2IOHandler.cpp      | 33 ++++++++++++---------------
 src/IO/HDF5/HDF5IOHandler.cpp         | 12 ++++------
 src/IO/HDF5/ParallelHDF5IOHandler.cpp | 19 ++++++++-------
 src/IO/JSON/JSONIOHandlerImpl.cpp     | 15 +++---------
 4 files changed, 30 insertions(+), 49 deletions(-)

diff --git a/src/IO/ADIOS/ADIOS2IOHandler.cpp b/src/IO/ADIOS/ADIOS2IOHandler.cpp
index 2263eb3079..8cddd578a0 100644
--- a/src/IO/ADIOS/ADIOS2IOHandler.cpp
+++ b/src/IO/ADIOS/ADIOS2IOHandler.cpp
@@ -3433,38 +3433,33 @@ ADIOS2IOHandler::flush(internal::ParsedFlushParams &flushParams)
 
 #else // openPMD_HAVE_ADIOS2
 
-namespace detail
-{
-    template <typename... Args>
-    void forget(Args...)
-    {}
-} // namespace detail
-
 #if openPMD_HAVE_MPI
 ADIOS2IOHandler::ADIOS2IOHandler(
     std::string path,
     Access at,
     MPI_Comm comm,
-    json::TracingJSON a,
-    std::string b,
-    std::string c)
+    // NOLINTNEXTLINE(performance-unnecessary-value-param)
+    json::TracingJSON,
+    // NOLINTNEXTLINE(performance-unnecessary-value-param)
+    std::string,
+    // NOLINTNEXTLINE(performance-unnecessary-value-param)
+    std::string)
     : AbstractIOHandler(std::move(path), at, comm)
-{
-    detail::forget(a, b, c);
-}
+{}
 
 #endif // openPMD_HAVE_MPI
 
 ADIOS2IOHandler::ADIOS2IOHandler(
     std::string path,
     Access at,
-    json::TracingJSON a,
-    std::string b,
-    std::string c)
+    // NOLINTNEXTLINE(performance-unnecessary-value-param)
+    json::TracingJSON,
+    // NOLINTNEXTLINE(performance-unnecessary-value-param)
+    std::string,
+    // NOLINTNEXTLINE(performance-unnecessary-value-param)
+    std::string)
     : AbstractIOHandler(std::move(path), at)
-{
-    detail::forget(std::move(a), std::move(b), std::move(c));
-}
+{}
 
 std::future<void> ADIOS2IOHandler::flush(internal::ParsedFlushParams &)
 {
diff --git a/src/IO/HDF5/HDF5IOHandler.cpp b/src/IO/HDF5/HDF5IOHandler.cpp
index c052ce3f95..e2fa63d9b3 100644
--- a/src/IO/HDF5/HDF5IOHandler.cpp
+++ b/src/IO/HDF5/HDF5IOHandler.cpp
@@ -2814,18 +2814,14 @@ std::future<void> HDF5IOHandler::flush(internal::ParsedFlushParams &)
     return m_impl->flush();
 }
 #else
-namespace detail
-{
-    template <typename T>
-    void forget(T)
-    {}
-} // namespace detail
 
 HDF5IOHandler::HDF5IOHandler(
-    std::string path, Access at, json::TracingJSON config)
+    std::string path,
+    Access at,
+    // NOLINTNEXTLINE(performance-unnecessary-value-param)
+    [[maybe_unused]] json::TracingJSON config)
     : AbstractIOHandler(std::move(path), at)
 {
-    detail::forget(std::move(config));
     throw std::runtime_error("openPMD-api built without HDF5 support");
 }
 
diff --git a/src/IO/HDF5/ParallelHDF5IOHandler.cpp b/src/IO/HDF5/ParallelHDF5IOHandler.cpp
index 5f7fa8edcb..47a7764480 100644
--- a/src/IO/HDF5/ParallelHDF5IOHandler.cpp
+++ b/src/IO/HDF5/ParallelHDF5IOHandler.cpp
@@ -180,27 +180,26 @@ ParallelHDF5IOHandlerImpl::~ParallelHDF5IOHandlerImpl()
     }
 }
 #else
-namespace detail
-{
-    template <typename T>
-    void forget(T)
-    {}
-} // namespace detail
 
 #if openPMD_HAVE_MPI
 ParallelHDF5IOHandler::ParallelHDF5IOHandler(
-    std::string path, Access at, MPI_Comm comm, json::TracingJSON config)
+    std::string path,
+    Access at,
+    MPI_Comm comm,
+    // NOLINTNEXTLINE(performance-unnecessary-value-param)
+    [[maybe_unused]] json::TracingJSON config)
     : AbstractIOHandler(std::move(path), at, comm)
 {
-    detail::forget(std::move(config));
     throw std::runtime_error("openPMD-api built without HDF5 support");
 }
 #else
 ParallelHDF5IOHandler::ParallelHDF5IOHandler(
-    std::string const &path, Access at, json::TracingJSON config)
+    std::string const &path,
+    Access at,
+    // NOLINTNEXTLINE(performance-unnecessary-value-param)
+    [[maybe_unused]] json::TracingJSON config)
     : AbstractIOHandler(path, at)
 {
-    detail::forget(std::move(config));
     throw std::runtime_error(
         "openPMD-api built without parallel support and without HDF5 support");
 }
diff --git a/src/IO/JSON/JSONIOHandlerImpl.cpp b/src/IO/JSON/JSONIOHandlerImpl.cpp
index 3a77e71ec5..a4e1bb39ab 100644
--- a/src/IO/JSON/JSONIOHandlerImpl.cpp
+++ b/src/IO/JSON/JSONIOHandlerImpl.cpp
@@ -122,25 +122,16 @@ namespace
     }
 } // namespace
 
-namespace detail
-{
-    template <typename T>
-    void forget(T)
-    {}
-} // namespace detail
-
 JSONIOHandlerImpl::JSONIOHandlerImpl(
     AbstractIOHandler *handler,
-    openPMD::json::TracingJSON config,
+    // NOLINTNEXTLINE(performance-unnecessary-value-param)
+    [[maybe_unused]] openPMD::json::TracingJSON config,
     FileFormat format,
     std::string originalExtension)
     : AbstractIOHandlerImpl(handler)
     , m_fileFormat{format}
     , m_originalExtension{std::move(originalExtension)}
-{
-    // Currently unused
-    detail::forget(std::move(config));
-}
+{}
 
 JSONIOHandlerImpl::~JSONIOHandlerImpl() = default;