Make things that can throw not noexcept anymore

This does involve making a large number of destructors able to throw,
because we had to change it high in the class hierarchy. Oh well.

Change-Id: Ib62d3d6895b755f20322bb8acc9bf43daf0174b2
This commit is contained in:
Jade Lovelace 2024-03-29 20:26:38 -07:00
parent 1fa6a3e335
commit 194a1b91af
8 changed files with 10 additions and 10 deletions

View file

@ -108,7 +108,7 @@ DerivationGoal::DerivationGoal(const StorePath & drvPath, const BasicDerivation
}
DerivationGoal::~DerivationGoal()
DerivationGoal::~DerivationGoal() noexcept(false)
{
/* Careful: we should never ever throw an exception from a
destructor. */

View file

@ -215,7 +215,7 @@ struct DerivationGoal : public Goal
DerivationGoal(const StorePath & drvPath, const BasicDerivation & drv,
const OutputsSpec & wantedOutputs, Worker & worker,
BuildMode buildMode = bmNormal);
virtual ~DerivationGoal();
virtual ~DerivationGoal() noexcept(false);
void timedOut(Error && ex) override;

View file

@ -127,7 +127,7 @@ public:
: worker(worker)
{ }
virtual ~Goal()
virtual ~Goal() noexcept(false)
{
trace("goal destroyed");
}

View file

@ -96,7 +96,7 @@ void handleDiffHook(
const Path LocalDerivationGoal::homeDir = "/homeless-shelter";
LocalDerivationGoal::~LocalDerivationGoal()
LocalDerivationGoal::~LocalDerivationGoal() noexcept(false)
{
/* Careful: we should never ever throw an exception from a
destructor. */

View file

@ -179,7 +179,7 @@ struct LocalDerivationGoal : public DerivationGoal
using DerivationGoal::DerivationGoal;
virtual ~LocalDerivationGoal() override;
virtual ~LocalDerivationGoal() noexcept(false) override;
/**
* Whether we need to perform hash rewriting if there are valid output paths.

View file

@ -108,7 +108,7 @@ struct StoreConfig : public Config
static StringSet getDefaultSystemFeatures();
virtual ~StoreConfig() { }
virtual ~StoreConfig() noexcept(false) { }
/**
* The name of this type of store.
@ -220,7 +220,7 @@ public:
*/
virtual void init() {};
virtual ~Store() { }
virtual ~Store() noexcept(false) { }
virtual std::string getUri() = 0;

View file

@ -947,7 +947,7 @@ Pid::Pid(pid_t pid)
}
Pid::~Pid()
Pid::~Pid() noexcept(false)
{
if (pid != -1) kill();
}

View file

@ -335,7 +335,7 @@ public:
AutoCloseFD(AutoCloseFD&& fd);
~AutoCloseFD();
AutoCloseFD& operator =(const AutoCloseFD & fd) = delete;
AutoCloseFD& operator =(AutoCloseFD&& fd);
AutoCloseFD& operator =(AutoCloseFD&& fd) noexcept(false);
int get() const;
explicit operator bool() const;
int release();
@ -384,7 +384,7 @@ class Pid
public:
Pid();
Pid(pid_t pid);
~Pid();
~Pid() noexcept(false);
void operator =(pid_t pid);
operator pid_t();
int kill();