Add std::uncaught_exceptions() to libcxxrt (C++17, see N4152 and N4259).

This has also been submitted upstream.
This commit is contained in:
Dimitry Andric 2015-10-05 17:47:23 +00:00
parent 65dcb5bcb1
commit bb52ed3249
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/projects/clang370-import/; revision=288830
2 changed files with 15 additions and 0 deletions

View File

@ -1473,6 +1473,15 @@ namespace std
__cxa_thread_info *info = thread_info(); __cxa_thread_info *info = thread_info();
return info->globals.uncaughtExceptions != 0; return info->globals.uncaughtExceptions != 0;
} }
/**
* Returns the number of exceptions currently being thrown that have not
* been caught. This can occur inside a nested catch statement.
*/
int uncaught_exceptions() throw()
{
__cxa_thread_info *info = thread_info();
return info->globals.uncaughtExceptions;
}
/** /**
* Returns the current unexpected handler. * Returns the current unexpected handler.
*/ */

View File

@ -356,3 +356,9 @@ GLIBCXX_3.4.9 {
}; };
} GLIBCXX_3.4; } GLIBCXX_3.4;
GLIBCXX_3.4.22 {
extern "C++" {
"std::uncaught_exceptions()";
};
} GLIBCXX_3.4.9;