Skip to content

Commit a1c2e55

Browse files
committed
add missing noinline to panic functions
1 parent c4ffe17 commit a1c2e55

File tree

1 file changed

+3
-3
lines changed
  • libsafecxx/single-header

1 file changed

+3
-3
lines changed

libsafecxx/single-header/std2.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ basic_string_view/(a)
168168
static constexpr size_type npos = size_type(-1);
169169

170170
private:
171-
[[noreturn, safety::panic(panic_code::generic)]]
171+
[[noreturn, noinline, safety::panic(panic_code::generic)]]
172172
static
173173
void panic_impl(string_constant<char> msg, source_location loc = source_location::current()) safe
174174
{
@@ -437,7 +437,7 @@ auto operator""sv2(wchar_t const* p, std::size_t len) noexcept safe -> wstring_v
437437
// Panic functions are categorized and marked with an safety::panic(N) attribute.
438438
// This makes it easy for the frontend to toggle on or off panic calls on a
439439
// per-file basis.
440-
[[noreturn, safety::panic(panic_code::generic)]]
440+
[[noreturn, noinline, safety::panic(panic_code::generic)]]
441441
inline void panic(
442442
str msg, source_location loc = source_location::current()) noexcept safe
443443
{
@@ -455,7 +455,7 @@ inline void panic(
455455
}
456456
}
457457

458-
[[noreturn, safety::panic(panic_code::bounds)]]
458+
[[noreturn, noinline, safety::panic(panic_code::bounds)]]
459459
inline void panic_bounds(
460460
str msg, source_location loc = source_location::current()) noexcept safe
461461
{

0 commit comments

Comments
 (0)