Skip to content

Commit

Permalink
fix noexcept
Browse files Browse the repository at this point in the history
  • Loading branch information
esseivaju committed Nov 28, 2024
1 parent 876dc9f commit 47f1cc4
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 8 deletions.
2 changes: 0 additions & 2 deletions src/corecel/sys/ScopedMem.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
//---------------------------------------------------------------------------//
#include "ScopedMem.hh"

#include "corecel/Config.hh"

#if defined(__APPLE__)
# include <cstring>
# include <mach/mach.h>
Expand Down
2 changes: 2 additions & 0 deletions src/corecel/sys/ScopedMem.hh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

#include <string_view>

#include "corecel/Config.hh"

#include "corecel/cont/InitializedValue.hh"

#include "MemRegistry.hh"
Expand Down
4 changes: 3 additions & 1 deletion src/orange/surf/GeneralQuadric.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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()),
Expand Down
5 changes: 4 additions & 1 deletion src/orange/surf/GeneralQuadric.hh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
//---------------------------------------------------------------------------//
#pragma once

#include "corecel/Config.hh"

#include "corecel/Types.hh"
#include "corecel/cont/Array.hh"
#include "corecel/cont/Span.hh"
Expand Down Expand Up @@ -70,7 +72,8 @@ class GeneralQuadric
explicit inline CELER_FUNCTION GeneralQuadric(Span<R, StorageSpan::extent>);

// Promote from a simple quadric
explicit GeneralQuadric(SimpleQuadric const& other) noexcept;
explicit GeneralQuadric(SimpleQuadric const& other) noexcept(
!CELERITAS_DEBUG);

//// ACCESSORS ////

Expand Down
6 changes: 4 additions & 2 deletions src/orange/surf/SimpleQuadric.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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())}
{
}
Expand Down Expand Up @@ -95,8 +96,9 @@ template SimpleQuadric::SimpleQuadric(CylAligned<Axis::z> 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();

Expand Down
6 changes: 4 additions & 2 deletions src/orange/surf/SimpleQuadric.hh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
//---------------------------------------------------------------------------//
#pragma once

#include "corecel/Config.hh"

#include "corecel/Types.hh"
#include "corecel/cont/Array.hh"
#include "corecel/cont/Span.hh"
Expand Down Expand Up @@ -69,14 +71,14 @@ class SimpleQuadric
explicit inline CELER_FUNCTION SimpleQuadric(Span<R, StorageSpan::extent>);

// 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<Axis T>
explicit SimpleQuadric(CylAligned<T> 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<Axis T>
Expand Down

0 comments on commit 47f1cc4

Please sign in to comment.