Skip to content

Commit

Permalink
Add noexcept(false) to most of dtors
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexPeshkoff committed Oct 6, 2023
1 parent 5327ed8 commit 957768c
Show file tree
Hide file tree
Showing 162 changed files with 544 additions and 543 deletions.
4 changes: 2 additions & 2 deletions extern/cloop/src/cloop/Generator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ void CppGenerator::generate()
fprintf(out, "\t\t{\n");
fprintf(out, "\t\t}\n");
fprintf(out, "\n");
fprintf(out, "\t\t~%s%s()\n", prefix.c_str(), interface->name.c_str());
fprintf(out, "\t\t~%s%s() noexcept(false)\n", prefix.c_str(), interface->name.c_str());
fprintf(out, "\t\t{\n");
fprintf(out, "\t\t}\n");
fprintf(out, "\n");
Expand Down Expand Up @@ -656,7 +656,7 @@ void CppGenerator::generate()
fprintf(out, "\t\t}\n");
fprintf(out, "\n");
fprintf(out, "\tpublic:\n");
fprintf(out, "\t\tvirtual ~%s%sImpl()\n", prefix.c_str(), interface->name.c_str());
fprintf(out, "\t\tvirtual ~%s%sImpl() noexcept(false)\n", prefix.c_str(), interface->name.c_str());
fprintf(out, "\t\t{\n");
fprintf(out, "\t\t}\n");
fprintf(out, "\n");
Expand Down
20 changes: 10 additions & 10 deletions extern/cloop/src/tests/test1/CalcCppApi.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ namespace calc
{
}

~IDisposable()
~IDisposable() noexcept(false)
{
}

Expand Down Expand Up @@ -101,7 +101,7 @@ namespace calc
{
}

~IStatus()
~IStatus() noexcept(false)
{
}

Expand Down Expand Up @@ -143,7 +143,7 @@ namespace calc
{
}

~IFactory()
~IFactory() noexcept(false)
{
}

Expand Down Expand Up @@ -200,7 +200,7 @@ namespace calc
{
}

~ICalculator()
~ICalculator() noexcept(false)
{
}

Expand Down Expand Up @@ -266,7 +266,7 @@ namespace calc
{
}

~ICalculator2()
~ICalculator2() noexcept(false)
{
}

Expand Down Expand Up @@ -340,7 +340,7 @@ namespace calc
}

public:
virtual ~IDisposableImpl()
virtual ~IDisposableImpl() noexcept(false)
{
}

Expand Down Expand Up @@ -416,7 +416,7 @@ namespace calc
}

public:
virtual ~IStatusImpl()
virtual ~IStatusImpl() noexcept(false)
{
}

Expand Down Expand Up @@ -528,7 +528,7 @@ namespace calc
}

public:
virtual ~IFactoryImpl()
virtual ~IFactoryImpl() noexcept(false)
{
}

Expand Down Expand Up @@ -638,7 +638,7 @@ namespace calc
}

public:
virtual ~ICalculatorImpl()
virtual ~ICalculatorImpl() noexcept(false)
{
}

Expand Down Expand Up @@ -790,7 +790,7 @@ namespace calc
}

public:
virtual ~ICalculator2Impl()
virtual ~ICalculator2Impl() noexcept(false)
{
}

Expand Down
2 changes: 1 addition & 1 deletion src/auth/SecDbCache.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class CachedSecurityDatabase final
}
}

~Instance()
~Instance() noexcept(false)
{
if (hasData())
{
Expand Down
2 changes: 1 addition & 1 deletion src/auth/SecureRemotePassword/Message.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class Message
}
}

~Message()
~Message() noexcept(false)
{
delete[] buffer;
#ifndef INTERNAL_FIREBIRD
Expand Down
8 changes: 4 additions & 4 deletions src/burp/BurpTasks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class BurpGblHolder
fb_assert(!m_prev_item || m_prev_item == item);
}

~BurpGblHolder()
~BurpGblHolder() noexcept(false)
{
BurpGlobals* gbl = BurpGlobals::getSpecific();
gbl->taskItem = m_prev_item;
Expand Down Expand Up @@ -140,7 +140,7 @@ BackupRelationTask::BackupRelationTask(BurpGlobals* tdgbl) : Task(),
}
}

BackupRelationTask::~BackupRelationTask()
BackupRelationTask::~BackupRelationTask() noexcept(false)
{
for (Item** p = m_items.begin(); p < m_items.end(); p++)
{
Expand Down Expand Up @@ -612,7 +612,7 @@ bool BackupRelationTask::fileWriter(Item& item)
return true;
}

BackupRelationTask::Item::EnsureUnlockBuffer::~EnsureUnlockBuffer()
BackupRelationTask::Item::EnsureUnlockBuffer::~EnsureUnlockBuffer() noexcept(false)
{
if (m_item && m_item->m_buffer)
m_item->m_buffer->unlock(true);
Expand Down Expand Up @@ -1098,7 +1098,7 @@ void RestoreRelationTask::putCleanBuffer(IOBuffer* buf)
m_cleanBuffers.push(buf);
}

RestoreRelationTask::Item::EnsureUnlockBuffer::~EnsureUnlockBuffer()
RestoreRelationTask::Item::EnsureUnlockBuffer::~EnsureUnlockBuffer() noexcept(false)
{
if (m_item && m_item->m_buffer)
m_item->m_buffer->unlock(true);
Expand Down
14 changes: 7 additions & 7 deletions src/burp/BurpTasks.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class ReadRelationReq
m_request = 0;
}

~ReadRelationReq()
~ReadRelationReq() noexcept(false)
{
clear();
}
Expand Down Expand Up @@ -177,7 +177,7 @@ class WriteRelationReq
m_resync = true;
}

~WriteRelationReq()
~WriteRelationReq() noexcept(false)
{
clear();
}
Expand Down Expand Up @@ -239,7 +239,7 @@ class BackupRelationTask : public Firebird::Task
{
public:
BackupRelationTask(BurpGlobals* tdgbl);
~BackupRelationTask();
~BackupRelationTask() noexcept(false);

void SetRelation(burp_rel* relation);

Expand Down Expand Up @@ -273,7 +273,7 @@ class BackupRelationTask : public Firebird::Task
{
public:
EnsureUnlockBuffer(Item* item) : m_item(item) {}
~EnsureUnlockBuffer();
~EnsureUnlockBuffer() noexcept(false);

private:
Item* m_item;
Expand Down Expand Up @@ -346,7 +346,7 @@ class RestoreRelationTask : public Firebird::Task
{
public:
RestoreRelationTask(BurpGlobals* tdgbl);
~RestoreRelationTask();
~RestoreRelationTask() noexcept(false);

void SetRelation(BurpGlobals* tdgbl, burp_rel* relation);

Expand Down Expand Up @@ -378,7 +378,7 @@ class RestoreRelationTask : public Firebird::Task
{
public:
EnsureUnlockBuffer(Item* item) : m_item(item) {}
~EnsureUnlockBuffer();
~EnsureUnlockBuffer() noexcept(false);

private:
Item* m_item;
Expand Down Expand Up @@ -593,7 +593,7 @@ class BurpMaster
m_task->burpOutMutex.enter(FB_FUNCTION);
}

~BurpMaster()
~BurpMaster() noexcept(false)
{
if (m_task)
m_task->burpOutMutex.leave();
Expand Down
2 changes: 1 addition & 1 deletion src/burp/burp.h
Original file line number Diff line number Diff line change
Expand Up @@ -946,7 +946,7 @@ class GblPool
: gbl_pool(ownPool ? MemoryPool::createPool(getDefaultMemoryPool()) : getDefaultMemoryPool())
{ }

~GblPool()
~GblPool() noexcept(false)
{
if (gbl_pool != getDefaultMemoryPool())
Firebird::MemoryPool::deletePool(gbl_pool);
Expand Down
4 changes: 2 additions & 2 deletions src/common/SimilarToRegex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,7 @@ SimilarToRegex::SimilarToRegex(MemoryPool& pool, unsigned flags,
finalizer = pool.registerFinalizer(finalize, this);
}

SimilarToRegex::~SimilarToRegex()
SimilarToRegex::~SimilarToRegex() noexcept(false)
{
getPool().unregisterFinalizer(finalizer);
}
Expand Down Expand Up @@ -860,7 +860,7 @@ SubstringSimilarRegex::SubstringSimilarRegex(MemoryPool& pool, unsigned flags,
finalizer = pool.registerFinalizer(finalize, this);
}

SubstringSimilarRegex::~SubstringSimilarRegex()
SubstringSimilarRegex::~SubstringSimilarRegex() noexcept(false)
{
getPool().unregisterFinalizer(finalizer);
}
Expand Down
4 changes: 2 additions & 2 deletions src/common/SimilarToRegex.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class SimilarToRegex : public PermanentStorage
public:
SimilarToRegex(MemoryPool& pool, unsigned flags,
const char* patternStr, unsigned patternLen, const char* escapeStr, unsigned escapeLen);
~SimilarToRegex();
~SimilarToRegex() noexcept(false);

public:
static bool isSpecialChar(ULONG c)
Expand Down Expand Up @@ -96,7 +96,7 @@ class SubstringSimilarRegex : public PermanentStorage
public:
SubstringSimilarRegex(MemoryPool& pool, unsigned flags,
const char* patternStr, unsigned patternLen, const char* escapeStr, unsigned escapeLen);
~SubstringSimilarRegex();
~SubstringSimilarRegex() noexcept(false);

private:
static void finalize(SubstringSimilarRegex* self);
Expand Down
2 changes: 1 addition & 1 deletion src/common/StatusArg.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class Base
virtual bool compare(const StatusVector& /*v*/) const noexcept { return false; }

ImplBase(ISC_STATUS k, ISC_STATUS c) noexcept : kind(k), code(c) { }
virtual ~ImplBase() { }
virtual ~ImplBase() noexcept(false) { }
};

Base(ISC_STATUS k, ISC_STATUS c);
Expand Down
2 changes: 1 addition & 1 deletion src/common/StatusHolder.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class DynamicVector : private SimpleStatusVector<S>
fb_utils::init_status(this->getBuffer(3));
}

~DynamicVector()
~DynamicVector() noexcept(false)
{
delete[] findDynamicStrings(this->getCount(), this->begin());
}
Expand Down
2 changes: 1 addition & 1 deletion src/common/Task.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ bool Worker::waitFor(int timeout)

/// class Coordinator

Coordinator::~Coordinator()
Coordinator::~Coordinator() noexcept(false)
{
MutexLockGuard guard(m_mutex, FB_FUNCTION);

Expand Down
10 changes: 5 additions & 5 deletions src/common/Task.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class Task
{
public:
Task() {};
virtual ~Task() {};
virtual ~Task() noexcept(false) {};

// task item to handle
class WorkItem
Expand All @@ -59,7 +59,7 @@ class Task
m_task(task)
{}

virtual ~WorkItem() {}
virtual ~WorkItem() noexcept(false) {}

Task* m_task;
};
Expand All @@ -84,7 +84,7 @@ class Worker final
{
}

virtual ~Worker() {}
virtual ~Worker() noexcept(false) {}

void setTask(Task* task)
{
Expand Down Expand Up @@ -119,7 +119,7 @@ class Coordinator final
m_activeThreads(*m_pool)
{}

~Coordinator();
~Coordinator() noexcept(false);

void runSync(Task*);

Expand Down Expand Up @@ -165,7 +165,7 @@ class WorkerThread final
public:
enum STATE {STARTING, IDLE, RUNNING, STOPPING, SHUTDOWN};

~WorkerThread()
~WorkerThread() noexcept(false)
{
shutdown(true);

Expand Down
2 changes: 1 addition & 1 deletion src/common/classes/ClumpletReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class ClumpletReader : protected AutoStorage
// Different versions of clumplets may have different kinds
ClumpletReader(const KindList* kl, const UCHAR* buffer, FB_SIZE_T buffLen, FPTR_VOID raise = NULL);
ClumpletReader(MemoryPool& pool, const KindList* kl, const UCHAR* buffer, FB_SIZE_T buffLen, FPTR_VOID raise = NULL);
virtual ~ClumpletReader() { }
virtual ~ClumpletReader() noexcept(false) { }

// Create a copy of reader
ClumpletReader(MemoryPool& pool, const ClumpletReader& from);
Expand Down
2 changes: 1 addition & 1 deletion src/common/classes/File.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ namespace Firebird {
class File
{
public:
virtual ~File() {}
virtual ~File() noexcept(false) {}

virtual FB_SIZE_T read(offset_t, void*, FB_SIZE_T) = 0;
virtual FB_SIZE_T write(offset_t, const void*, FB_SIZE_T) = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/common/classes/GenericMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ class GenericMap : public AutoStorage
: AutoStorage(a_pool), tree(&getPool()), mCount(0)
{ }

~GenericMap()
~GenericMap() noexcept(false)
{
clear();
}
Expand Down
2 changes: 1 addition & 1 deletion src/common/classes/GetPlugins.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ class GetPlugins
check(&status);
}

void removePlugin()
void removePlugin() noexcept
{
if (hasData())
{
Expand Down

0 comments on commit 957768c

Please sign in to comment.