From 47f1cc4099d18a19bfaf9ebfa3d25c2815816169 Mon Sep 17 00:00:00 2001 From: Julien Esseiva Date: Thu, 28 Nov 2024 11:51:18 -0800 Subject: [PATCH] fix noexcept --- src/corecel/sys/ScopedMem.cc | 2 -- src/corecel/sys/ScopedMem.hh | 2 ++ src/orange/surf/GeneralQuadric.cc | 4 +++- src/orange/surf/GeneralQuadric.hh | 5 ++++- src/orange/surf/SimpleQuadric.cc | 6 ++++-- src/orange/surf/SimpleQuadric.hh | 6 ++++-- 6 files changed, 17 insertions(+), 8 deletions(-) diff --git a/src/corecel/sys/ScopedMem.cc b/src/corecel/sys/ScopedMem.cc index c89199dedf..ba93ed4a42 100644 --- a/src/corecel/sys/ScopedMem.cc +++ b/src/corecel/sys/ScopedMem.cc @@ -7,8 +7,6 @@ //---------------------------------------------------------------------------// #include "ScopedMem.hh" -#include "corecel/Config.hh" - #if defined(__APPLE__) # include # include diff --git a/src/corecel/sys/ScopedMem.hh b/src/corecel/sys/ScopedMem.hh index 4884dee2b2..68af7c1049 100644 --- a/src/corecel/sys/ScopedMem.hh +++ b/src/corecel/sys/ScopedMem.hh @@ -9,6 +9,8 @@ #include +#include "corecel/Config.hh" + #include "corecel/cont/InitializedValue.hh" #include "MemRegistry.hh" diff --git a/src/orange/surf/GeneralQuadric.cc b/src/orange/surf/GeneralQuadric.cc index 9154b51280..82cda9e26a 100644 --- a/src/orange/surf/GeneralQuadric.cc +++ b/src/orange/surf/GeneralQuadric.cc @@ -44,8 +44,10 @@ GeneralQuadric::GeneralQuadric(Real3 const& abc, /*! * Promote from a simple quadric. */ +// Remove after upgrade to clang-tidy-18: // NOLINTNEXTLINE(bugprone-exception-escape) -GeneralQuadric::GeneralQuadric(SimpleQuadric const& other) noexcept +GeneralQuadric::GeneralQuadric(SimpleQuadric const& other) noexcept( + !CELERITAS_DEBUG) : GeneralQuadric{make_array(other.second()), Real3{0, 0, 0}, make_array(other.first()), diff --git a/src/orange/surf/GeneralQuadric.hh b/src/orange/surf/GeneralQuadric.hh index 2d2f2e19ce..be42990b12 100644 --- a/src/orange/surf/GeneralQuadric.hh +++ b/src/orange/surf/GeneralQuadric.hh @@ -7,6 +7,8 @@ //---------------------------------------------------------------------------// #pragma once +#include "corecel/Config.hh" + #include "corecel/Types.hh" #include "corecel/cont/Array.hh" #include "corecel/cont/Span.hh" @@ -70,7 +72,8 @@ class GeneralQuadric explicit inline CELER_FUNCTION GeneralQuadric(Span); // Promote from a simple quadric - explicit GeneralQuadric(SimpleQuadric const& other) noexcept; + explicit GeneralQuadric(SimpleQuadric const& other) noexcept( + !CELERITAS_DEBUG); //// ACCESSORS //// diff --git a/src/orange/surf/SimpleQuadric.cc b/src/orange/surf/SimpleQuadric.cc index 4c1fdf7306..21bee90ea8 100644 --- a/src/orange/surf/SimpleQuadric.cc +++ b/src/orange/surf/SimpleQuadric.cc @@ -48,8 +48,9 @@ SimpleQuadric::SimpleQuadric(Real3 const& abc, Real3 const& def, real_type g) * whereas the simple quadric has a different sign for the constant: * \f$ dx + ey + fz + g = 0 \f$ . */ +// Remove after upgrade to clang-tidy-18: // NOLINTNEXTLINE(bugprone-exception-escape) -SimpleQuadric::SimpleQuadric(Plane const& other) noexcept +SimpleQuadric::SimpleQuadric(Plane const& other) noexcept(!CELERITAS_DEBUG) : SimpleQuadric{{0, 0, 0}, other.normal(), negate(other.displacement())} { } @@ -95,8 +96,9 @@ template SimpleQuadric::SimpleQuadric(CylAligned const&) noexcept; + x_0^2 + y_0^2 + z_0^2 - r^2 = 0 * \endverbatim */ +// Remove after upgrade to clang-tidy-18: // NOLINTNEXTLINE(bugprone-exception-escape) -SimpleQuadric::SimpleQuadric(Sphere const& other) noexcept +SimpleQuadric::SimpleQuadric(Sphere const& other) noexcept(!CELERITAS_DEBUG) { Real3 const& origin = other.origin(); diff --git a/src/orange/surf/SimpleQuadric.hh b/src/orange/surf/SimpleQuadric.hh index 616f943e5f..9a83ba4106 100644 --- a/src/orange/surf/SimpleQuadric.hh +++ b/src/orange/surf/SimpleQuadric.hh @@ -7,6 +7,8 @@ //---------------------------------------------------------------------------// #pragma once +#include "corecel/Config.hh" + #include "corecel/Types.hh" #include "corecel/cont/Array.hh" #include "corecel/cont/Span.hh" @@ -69,14 +71,14 @@ class SimpleQuadric explicit inline CELER_FUNCTION SimpleQuadric(Span); // Promote from a plane - explicit SimpleQuadric(Plane const& other) noexcept; + explicit SimpleQuadric(Plane const& other) noexcept(!CELERITAS_DEBUG); // Promote from an axis-aligned cylinder template explicit SimpleQuadric(CylAligned const& other) noexcept; // Promote from a sphere - explicit SimpleQuadric(Sphere const& other) noexcept; + explicit SimpleQuadric(Sphere const& other) noexcept(!CELERITAS_DEBUG); // Promote from a cone template