I find it very odd that https://eel.is/c++draft/atomics.types.operations#lib:wait,atomic doesn't specify what happens during constant evaluation.
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html#wait argues that wait() during compile time would exceed implementation limits, but there is no implementation limit that's clearly exceeded here. Why shouldn't wait() be allowed to deadlock the compiler frontend? "system clock time" is not a limit in [implimits] after all, and even if it was, that's not a normative index.
Perhaps an argument against deadlocking the frontend is that https://eel.is/c++draft/intro.progress#1 specifies that any thread (presumably including the compiler frontend thread for constant evaluation) will make progress eventually. Core language UB is not a constant expression, and that includes [intro], so I guess that makes the call to wait() immediately invalid.
A possible way to clarify it is to say that atomic waiting operations are not constant expressions (either normatively or as a note), to include atomic_flag_wait, atomic_wait, atomic::wait, atomic_ref::wait, etc. in one fell swoop.
I find it very odd that https://eel.is/c++draft/atomics.types.operations#lib:wait,atomic doesn't specify what happens during constant evaluation.
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3309r3.html#wait argues that
wait()during compile time would exceed implementation limits, but there is no implementation limit that's clearly exceeded here. Why shouldn'twait()be allowed to deadlock the compiler frontend? "system clock time" is not a limit in [implimits] after all, and even if it was, that's not a normative index.Perhaps an argument against deadlocking the frontend is that https://eel.is/c++draft/intro.progress#1 specifies that any thread (presumably including the compiler frontend thread for constant evaluation) will make progress eventually. Core language UB is not a constant expression, and that includes [intro], so I guess that makes the call to
wait()immediately invalid.A possible way to clarify it is to say that atomic waiting operations are not constant expressions (either normatively or as a note), to include
atomic_flag_wait,atomic_wait,atomic::wait,atomic_ref::wait, etc. in one fell swoop.