shared(int) obj = 3; int expected = 3; static assert(__traits(compiles, {atomic_compare_exchange_weak_impl(&obj, &expected, 2);}));
See Implementation