Consider this function:
std::vector<unsigned> copy(std::vector<unsigned> const& v) noexcept
{ return v; }
int main()
{
try {
(void)copy({1, 2, 3});
} catch(...) {}
}
The construction by copy of the returned object could throw. In this case, would the exception be propagated to the caller (i.e. it's considered to happen in main) and thus would be handled in the catch(...) handler? Or would the exception run into noexcept and lead to invoking std::terminate()?
Have the changes about lifetimes rules in C++17/C++20 (standardized RVO, temporary materialization, implicit object creation, etc) changed some rules in this regard with respect to previous versions of the standard?