diff --git a/BaseLib/ConfigTree.cpp b/BaseLib/ConfigTree.cpp
index 4afc7151c103cc05cdb62fbda8cf62745d653a9b..592e5d3178f2dd49993b7c65180074decf22d224 100644
--- a/BaseLib/ConfigTree.cpp
+++ b/BaseLib/ConfigTree.cpp
@@ -73,7 +73,8 @@ ConfigTree(ConfigTree && other)
 
 ConfigTree::~ConfigTree()
 {
-    if (std::uncaught_exception()) {
+    if (std::uncaught_exceptions() > 0)
+    {
         /* If the stack unwinds the check below shall be suppressed in order to
          * not accumulate false-positive configuration errors.
          */