This is an archive of the discontinued LLVM Phabricator instance.

[libcxx] Fix rethrow_if_nested test on Windows.
Needs ReviewPublic

Authored by halyavin on Nov 13 2017, 8:38 AM.

Details

Summary

Stack overflow is caused by B copy constructor invoking default constructor of std::nested_exception which tries to capture current exception. Capturing current exception copies it and since our current exception is B, we call B's copy constructor and cause infinite recursion.

After fix, "throw b" no longer captures current exception (it copies it from B(5) object where it is empty) and so throw_if_nested terminates the test.

Diff Detail

Event Timeline

halyavin created this revision.Nov 13 2017, 8:38 AM