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

@@ -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);
}
}
}