Skip to content

Commit 225cbaf

Browse files
committed
Fixing clang errors and warnings
1 parent cf6e3fd commit 225cbaf

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

include/boost/leaf/config/tls_win32.hpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,7 @@ namespace detail
179179

180180
// This must be a literal type, dynamic initialization may break things
181181
// because the constructor may run after the tls callback is invoked.
182-
constexpr module_state() noexcept
183-
{
184-
}
182+
module_state() noexcept = default;
185183

186184
slot_map & sm() const noexcept
187185
{
@@ -219,11 +217,17 @@ namespace detail
219217
BOOST_LEAF_ASSERT(r), (void) r;
220218
return;
221219
}
220+
#ifndef BOOST_LEAF_NO_EXCEPTIONS
222221
try
223222
{
223+
#endif
224224
sm_ = *mapped_ptr = new slot_map;
225+
#ifdef BOOST_LEAF_NO_EXCEPTIONS
226+
if (!sm_)
227+
#else
225228
}
226229
catch(...)
230+
#endif
227231
{
228232
tls_failures_ |= tls_failure_slot_map;
229233
EXCEPTION_RECORD rec = {};

include/boost/leaf/result.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ class BOOST_LEAF_SYMBOL_VISIBLE BOOST_LEAF_ATTRIBUTE_NODISCARD result
222222
#endif
223223
default:
224224
BOOST_LEAF_ASSERT(k == result_discriminant::err_id);
225+
(void) k;
225226
case result_discriminant::err_id_zero:
226227
return result<U>(what.get_error_id());
227228
}
@@ -242,6 +243,7 @@ class BOOST_LEAF_SYMBOL_VISIBLE BOOST_LEAF_ATTRIBUTE_NODISCARD result
242243
{
243244
default:
244245
BOOST_LEAF_ASSERT(k == result_discriminant::err_id);
246+
(void) k;
245247
case result_discriminant::err_id_zero:
246248
break;
247249
case result_discriminant::err_id_capture_list:
@@ -264,6 +266,7 @@ class BOOST_LEAF_SYMBOL_VISIBLE BOOST_LEAF_ATTRIBUTE_NODISCARD result
264266
{
265267
default:
266268
BOOST_LEAF_ASSERT(k == result_discriminant::err_id);
269+
(void) k;
267270
case result_discriminant::err_id_zero:
268271
break;
269272
case result_discriminant::err_id_capture_list:

0 commit comments

Comments
 (0)