[EH] Increment uncaughtExceptionCount in __cxa_rethrow_primary_exception#26527
Conversation
This was missing, causing `std::uncaught_exceptions()` to return incorrect values.
|
|
||
| struct DestructorTester { | ||
| ~DestructorTester() { | ||
| std::cout << "Destructor Uncaught: " << std::uncaught_exceptions() << "\n"; |
There was a problem hiding this comment.
It sounds strange by can you just use printf here instead of cout ? Using iostreams ends up pulling in a lot of extra library code that isn't needed for the test.
test/test_core.py
Outdated
| self.do_core_test('test_exceptions_rethrow.cpp') | ||
|
|
||
| @with_all_eh_sjlj | ||
| def test_exceptions_rethrow_primary_uncaught(self): |
There was a problem hiding this comment.
I'm not sure I understand the choice of name here? How something like test_uncaught_exceptions_count or test_exceptions_count_uncaught?
There was a problem hiding this comment.
The name is because this is a test case from fixing a bug in __cxa_rethrow_primary_exception and it is printing the uncaught exception count. But yeah the name is not very intuitive. But turns out, we already have test_exceptions_uncaught, test_exceptions_uncaught_2, and test_exceptions_uncaught_count.... How about just renaming the existing test_exceptions_uncaught_count to test_exceptions_uncaught_3, and renaming the new one in this PR to test_exceptions_uncaught_4, to be consistent at least?
Will do that, please tell me if you don't like the names: d7fffa4
This was missing, causing
std::uncaught_exceptions()to return incorrect values.