On Fri, 28 Jan 2022 at 00:59, Martin Sebor wrote: > In practice, I'd expect most calls to atomic functions to be made > with constant memory models, and code like in the test case above > to be uncommon, so I think the choice of warning at -O0 was > the right one.
Some of us consider it a misfeature that the C++ functions use function parameters for the memory model at all. They could have been template arguments, so that only constants would be allowed: atomic.fetch<memory_order_seq_cst>();