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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user