Skip to content

Commit c58622e

Browse files
committed
try to make gcc happy
1 parent feba45d commit c58622e

2 files changed

Lines changed: 16 additions & 26 deletions

File tree

include/stdexec/__detail/__any.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -977,7 +977,7 @@ namespace STDEXEC::__any {
977977

978978
STDEXEC_IF_NOT_CONSTEVAL {
979979
STDEXEC_ASSERT(
980-
(std::convertible_to<_Value &, __value_ref_t>)
980+
(std::is_convertible_v<_Value &, __value_ref_t>)
981981
&& "attempt to get a mutable reference from a const reference, or an rvalue from an "
982982
"lvalue");
983983
}

include/stdexec/__detail/__utility.hpp

Lines changed: 15 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -314,48 +314,38 @@ namespace STDEXEC {
314314
#endif
315315
} // namespace __std
316316

317-
STDEXEC_PRAGMA_PUSH()
318-
STDEXEC_PRAGMA_IGNORE_GNU("-Winvalid-constexpr")
319-
320-
inline constexpr void __debug_printf_v(const char* __fmt, va_list __args) noexcept {
321-
STDEXEC_IF_CONSTEVAL {
322-
__std::unreachable();
323-
}
324-
else {
325-
std::vprintf(__fmt, __args);
326-
std::fflush(stdout);
327-
}
317+
inline void __debug_vprintf(const char* __fmt, va_list __args) noexcept {
318+
std::vprintf(__fmt, __args);
319+
std::fflush(stdout);
328320
}
329321

330322
template <class...> // To avoid gcc error about va_list not being usable in a constexpr function
331-
constexpr void __debug_printf(const char* __fmt, ...) noexcept {
332-
STDEXEC_IF_CONSTEVAL {
333-
__std::unreachable();
334-
}
335-
else {
336-
va_list __args;
337-
va_start(__args, __fmt);
338-
STDEXEC::__debug_printf_v(__fmt, __args);
339-
va_end(__args);
340-
}
323+
inline void __debug_printf(const char* __fmt, ...) noexcept {
324+
va_list __args;
325+
va_start(__args, __fmt);
326+
STDEXEC::__debug_vprintf(__fmt, __args);
327+
va_end(__args);
341328
}
342329

343330
template <class _Return = void>
344331
[[noreturn]]
345332
constexpr _Return __die(const char* __fmt, ...) noexcept {
346333
STDEXEC_IF_CONSTEVAL {
347-
__std::unreachable();
334+
// The following `if constexpr` is needed to keep compilers from complaining that
335+
// neither branch of the `if consteval` (above) is a constant expression.
336+
if constexpr (!__mnever<_Return>)
337+
{
338+
__std::unreachable();
339+
}
348340
}
349341
else {
350342
va_list __args;
351343
va_start(__args, __fmt);
352-
STDEXEC::__debug_printf_v(__fmt, __args);
344+
STDEXEC::__debug_vprintf(__fmt, __args);
353345
va_end(__args);
354346
STDEXEC_TERMINATE();
355347
}
356348
}
357-
358-
STDEXEC_PRAGMA_POP()
359349
} // namespace STDEXEC
360350

361351
STDEXEC_PRAGMA_POP()

0 commit comments

Comments
 (0)