Fix warnings about throwing destructors, which are by default noexcept

This commit is contained in:
Ion Gaztañaga
2018-11-17 00:21:41 +01:00
parent aecde39cc8
commit 53f328f4c1

View File

@@ -11,6 +11,7 @@
#include <boost/interprocess/detail/intermodule_singleton.hpp>
#include <boost/interprocess/detail/portable_intermodule_singleton.hpp>
#include <iostream>
#include <cstdlib> //for std::abort
using namespace boost::interprocess;
@@ -184,7 +185,8 @@ class LogPhoenixTester
sstr << "Logger<Tag>::constructed_times != Logger<Tag>::destroyed_times\n";
sstr << "(" << Logger<Tag>::constructed_times << " vs. " << Logger<Tag>::destroyed_times << ")\n";
}
throw std::runtime_error(sstr.str().c_str());
std::cout << "~LogPhoenixTester(), error: " << sstr.str() << std::endl;
std::abort();
}
}
};
@@ -214,7 +216,8 @@ class LogDeadReferenceUser
LogSingleton::get().log_it();
std::string s("LogDeadReferenceUser failed for LogSingleton ");
s += typeid(LogSingleton).name();
throw std::runtime_error(s.c_str());
std::cout << "~LogDeadReferenceUser(), error: " << s << std::endl;
std::abort();
}
catch(interprocess_exception &){
//Correct behaviour