@@ -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
361351STDEXEC_PRAGMA_POP ()
0 commit comments