From your own link:
Static storage duration
Temporaries aren't declared at all, so they can't be declared with the static
or extern
keywords. They generally won't belong to namespace scope.
Thread storage duration
Only if they're explicitly declared thread_local
, so that doesn't apply.
Automatic storage duration
Variables that belong to a block or parameter scope and are not explicitly declared static, thread_local, or extern have automatic storage duration.
This is going to apply to most temporaries, since they're not explicitly declared anything, and are created by an expression, most of which live somewhere inside a block scope.
The exception is a static bound to a reference which has non-automatic storage duration: it must inherit the reference's storage duration.
The documented example is a temporary bound to a reference which has namespace scope, and must inherit static duration.
const S& cr = S(16)+S(23);
Note in that example that the temporaries used as parameters to operator+
don't get static duration just because their expression is at namespace scope: they're still parameter scope and therefore automatic.