diff options
author | Marshall Clow <mclow.lists@gmail.com> | 2015-12-14 18:01:56 +0000 |
---|---|---|
committer | Marshall Clow <mclow.lists@gmail.com> | 2015-12-14 18:01:56 +0000 |
commit | 94b5bc4263609a620277d5678713f5e13efbb607 (patch) | |
tree | 7f43b8ce90aa880e6b6f55282863d2f358de9200 /libcxx/test/std/language.support/support.exception/except.nested | |
parent | 280f7101e8c82ae7e09a71f439dbcce18f2e18fc (diff) | |
download | bcm5719-llvm-94b5bc4263609a620277d5678713f5e13efbb607.tar.gz bcm5719-llvm-94b5bc4263609a620277d5678713f5e13efbb607.zip |
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.
llvm-svn: 255517
Diffstat (limited to 'libcxx/test/std/language.support/support.exception/except.nested')
-rw-r--r-- | libcxx/test/std/language.support/support.exception/except.nested/rethrow_if_nested.pass.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/libcxx/test/std/language.support/support.exception/except.nested/rethrow_if_nested.pass.cpp b/libcxx/test/std/language.support/support.exception/except.nested/rethrow_if_nested.pass.cpp index 9a44a4ec291..a8b6e15feab 100644 --- a/libcxx/test/std/language.support/support.exception/except.nested/rethrow_if_nested.pass.cpp +++ b/libcxx/test/std/language.support/support.exception/except.nested/rethrow_if_nested.pass.cpp @@ -37,6 +37,13 @@ public: B(const B& b) : A(b) {} }; +class C +{ +public: + virtual ~C() {} + C * operator&() const { assert(false); } // should not be called +}; + int main() { { @@ -79,7 +86,7 @@ int main() { try { - std::rethrow_if_nested(1); + std::rethrow_if_nested(C()); assert(true); } catch (...) @@ -87,4 +94,5 @@ int main() assert(false); } } + } |