In the following code, the stack-based variable \'ex\' is thrown and caught in a function beyond the scope in which ex was declared. This seems a bit strange to me, since (A
The object is copied into an exception object that survives stack-unwinding. Where the memory for that object comes from is unspecified. For big object, it will probably be malloc'ed, and for smaller objects, the implementation could have a pre-allocated buffer (i could imagine this could be used for a bad_alloc exception).
The reference ex is then bound to that exception object, which is a temporary (it has no name).