https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109529

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Since `static_cast<int volatile && >(x)` is considered rvalue and `int volatile
const &` needs to be bound, it will not be bound to a temporary (rvalue) which
is produced by the rvalue reference.

In the non-volatile case, well it is a const reference which can be bound to a
temporary value (rvalue) and that temp in this case will end its lifetime after
the end of the statement (after the ;).

Reply via email to