From b0076c9d8c9e6528e051653dfe37b972b642dbfe Mon Sep 17 00:00:00 2001 From: Paul Bauer Date: Fri, 27 Nov 2020 15:37:28 +0100 Subject: [PATCH] Fix build on CentOS 7 The compiler toolset coming with devtoolset-7 on CentOS still suffers from https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58265. The workaround for this has been removed before because other gcc-7 compilers are not affected by this, but it is obviously still needed for CentOS. Fixes #3826 --- src/gromacs/mdrun/runner.cpp | 3 ++- src/gromacs/mdrun/runner.h | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/gromacs/mdrun/runner.cpp b/src/gromacs/mdrun/runner.cpp index e78faae8d5..513d7733ee 100644 --- a/src/gromacs/mdrun/runner.cpp +++ b/src/gromacs/mdrun/runner.cpp @@ -1882,7 +1882,8 @@ Mdrunner::Mdrunner(std::unique_ptr mdModules) : mdModules_(std::move( Mdrunner::Mdrunner(Mdrunner&&) noexcept = default; -Mdrunner& Mdrunner::operator=(Mdrunner&& /*handle*/) noexcept = default; +//NOLINTNEXTLINE(performance-noexcept-move-constructor) working around GCC bug 58265 in CentOS 7 +Mdrunner& Mdrunner::operator=(Mdrunner&& /*handle*/) noexcept(BUGFREE_NOEXCEPT_STRING) = default; class Mdrunner::BuilderImplementation { diff --git a/src/gromacs/mdrun/runner.h b/src/gromacs/mdrun/runner.h index 703e632b34..a0c9cdc95d 100644 --- a/src/gromacs/mdrun/runner.h +++ b/src/gromacs/mdrun/runner.h @@ -78,6 +78,9 @@ class RestraintManager; class SimulationContext; class StopHandlerBuilder; +//! Work-around for GCC bug 58265 still present in CentOS 7 devtoolset-7 +constexpr bool BUGFREE_NOEXCEPT_STRING = std::is_nothrow_move_assignable::value; + /*! \libinternal \brief Runner object for supporting setup and execution of mdrun. * * This class has responsibility for the lifetime of data structures @@ -143,7 +146,8 @@ public: * \{ */ Mdrunner(Mdrunner&& handle) noexcept; - Mdrunner& operator=(Mdrunner&& handle) noexcept; + //NOLINTNEXTLINE(performance-noexcept-move-constructor) working around GCC bug 58265 in CentOS 7 + Mdrunner& operator=(Mdrunner&& handle) noexcept(BUGFREE_NOEXCEPT_STRING); /* \} */ /*! \brief Driver routine, that calls the different simulation methods. */ -- 2.22.0