Fix a corner case that involved calling rethrow_if_nested with a type that had a deleted operator&. Added a test to catch this as well. Thanks to Ville for the heads-up.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@255517 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Marshall Clow
2015-12-14 18:01:56 +00:00
parent 633fe505fe
commit b6621c5259
3 changed files with 10 additions and 53 deletions

View File

@@ -235,7 +235,7 @@ rethrow_if_nested(const _Ep& __e, typename enable_if<
is_polymorphic<_Ep>::value
>::type* = 0)
{
const nested_exception* __nep = dynamic_cast<const nested_exception*>(&__e);
const nested_exception* __nep = dynamic_cast<const nested_exception*>(_VSTD::addressof(__e));
if (__nep)
__nep->rethrow_nested();
}