std::throw_with_nested expects polymorphic type in C++11?
Why does this not compile (tried with Clang 3.4.2 and GCC versions 4.7.4, 4.8.3 and 4.9.1): #include <exception> struct E { E(int) {} }; int main() { std::throw_with_nested(E(42)); return 0; } Errors from GCC 4.9.1: In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.1/include/g++-v4/exception:163:0, from test.cpp:1: /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.1/include/g++-v4/bits/nested_exception.h: In instantiation of 'static const std::nested_exception* std::__get_nested_helper<_Ex>::_S_get(const _Ex&) [with _Ex = E]': /usr/lib/gcc/x86_64-pc-linux-gnu/4.9.1/include/g++-v4/bits/nested