summaryrefslogtreecommitdiffstats
path: root/contrib/libcxxrt
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2015-10-05 17:47:23 +0000
committerdim <dim@FreeBSD.org>2015-10-05 17:47:23 +0000
commitd463dc007445af010e1fa3fa6b66c3c561ef28b4 (patch)
tree7fceb2d8f3a8e174359735dd9e1ed29817dd1c21 /contrib/libcxxrt
parentc88ca1c4064bdfc5aa9a040453a2bedcab5563cf (diff)
downloadFreeBSD-src-d463dc007445af010e1fa3fa6b66c3c561ef28b4.zip
FreeBSD-src-d463dc007445af010e1fa3fa6b66c3c561ef28b4.tar.gz
Add std::uncaught_exceptions() to libcxxrt (C++17, see N4152 and N4259).
This has also been submitted upstream.
Diffstat (limited to 'contrib/libcxxrt')
-rw-r--r--contrib/libcxxrt/exception.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/contrib/libcxxrt/exception.cc b/contrib/libcxxrt/exception.cc
index c559f97..052541f 100644
--- a/contrib/libcxxrt/exception.cc
+++ b/contrib/libcxxrt/exception.cc
@@ -1474,6 +1474,15 @@ namespace std
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.
*/
unexpected_handler get_unexpected() throw()
OpenPOWER on IntegriCloud