Skip to content

Commit

Permalink
std::uncaught_exception() -> std::uncaught_exceptions()
Browse files Browse the repository at this point in the history
The former is deprecated in C++17. Fixes a clang warning.
  • Loading branch information
edolstra committed Sep 13, 2019
1 parent cf4c31c commit 6b83174
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/libstore/remote-store.cc
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ struct ConnectionHandle

~ConnectionHandle()
{
if (!daemonException && std::uncaught_exception()) {
if (!daemonException && std::uncaught_exceptions()) {
handle.markBad();
debug("closing daemon connection because of an exception");
}
Expand Down
2 changes: 1 addition & 1 deletion src/libutil/json.hh
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ public:

~JSONPlaceholder()
{
assert(!first || std::uncaught_exception());
assert(!first || std::uncaught_exceptions());
}

template<typename T>
Expand Down
2 changes: 1 addition & 1 deletion src/libutil/util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1169,7 +1169,7 @@ void _interrupted()
/* Block user interrupts while an exception is being handled.
Throwing an exception while another exception is being handled
kills the program! */
if (!interruptThrown && !std::uncaught_exception()) {
if (!interruptThrown && !std::uncaught_exceptions()) {
interruptThrown = true;
throw Interrupted("interrupted by the user");
}
Expand Down

0 comments on commit 6b83174

Please sign in to comment.