LGTM: [skip ci] fix: Inconsistent definition of copy constructor and assignment ('Rule of Two')
Remove user-defined copy constructor of Exception classes without assignment operator
This commit is contained in:
@@ -178,11 +178,6 @@ AbortException::AbortException()
|
||||
_sErrMsg = "Aborted operation";
|
||||
}
|
||||
|
||||
AbortException::AbortException(const AbortException &inst)
|
||||
: Exception(inst)
|
||||
{
|
||||
}
|
||||
|
||||
const char* AbortException::what() const throw()
|
||||
{
|
||||
return Exception::what();
|
||||
@@ -206,11 +201,6 @@ XMLBaseException::XMLBaseException(const std::string& sMessage)
|
||||
{
|
||||
}
|
||||
|
||||
XMLBaseException::XMLBaseException(const XMLBaseException &inst)
|
||||
: Exception(inst)
|
||||
{
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------
|
||||
|
||||
XMLParseException::XMLParseException(const char * sMessage)
|
||||
@@ -228,11 +218,6 @@ XMLParseException::XMLParseException()
|
||||
_sErrMsg = "XML parse exception";
|
||||
}
|
||||
|
||||
XMLParseException::XMLParseException(const XMLParseException &inst)
|
||||
: XMLBaseException(inst)
|
||||
{
|
||||
}
|
||||
|
||||
const char* XMLParseException::what() const throw()
|
||||
{
|
||||
return XMLBaseException::what();
|
||||
@@ -255,11 +240,6 @@ XMLAttributeError::XMLAttributeError()
|
||||
_sErrMsg = "XML attribute error";
|
||||
}
|
||||
|
||||
XMLAttributeError::XMLAttributeError(const XMLAttributeError &inst)
|
||||
: XMLBaseException(inst)
|
||||
{
|
||||
}
|
||||
|
||||
const char* XMLAttributeError::what() const throw()
|
||||
{
|
||||
return XMLBaseException::what();
|
||||
@@ -373,11 +353,6 @@ FileSystemError::FileSystemError(const std::string& sMessage)
|
||||
{
|
||||
}
|
||||
|
||||
FileSystemError::FileSystemError(const FileSystemError &inst)
|
||||
: Exception(inst)
|
||||
{
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------
|
||||
|
||||
|
||||
@@ -396,11 +371,6 @@ BadFormatError::BadFormatError(const std::string& sMessage)
|
||||
{
|
||||
}
|
||||
|
||||
BadFormatError::BadFormatError(const BadFormatError &inst)
|
||||
: Exception(inst)
|
||||
{
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------
|
||||
|
||||
|
||||
@@ -418,6 +388,12 @@ MemoryException::MemoryException(const MemoryException &inst)
|
||||
{
|
||||
}
|
||||
|
||||
MemoryException & MemoryException::operator=(const MemoryException &inst)
|
||||
{
|
||||
Exception::operator = (inst);
|
||||
return *this;
|
||||
}
|
||||
|
||||
#if defined (__GNUC__)
|
||||
const char* MemoryException::what() const throw()
|
||||
{
|
||||
@@ -443,11 +419,6 @@ AccessViolation::AccessViolation(const std::string& sMessage)
|
||||
{
|
||||
}
|
||||
|
||||
AccessViolation::AccessViolation(const AccessViolation &inst)
|
||||
: Exception(inst)
|
||||
{
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------
|
||||
|
||||
AbnormalProgramTermination::AbnormalProgramTermination()
|
||||
@@ -465,11 +436,6 @@ AbnormalProgramTermination::AbnormalProgramTermination(const std::string& sMessa
|
||||
{
|
||||
}
|
||||
|
||||
AbnormalProgramTermination::AbnormalProgramTermination(const AbnormalProgramTermination &inst)
|
||||
: Exception(inst)
|
||||
{
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------
|
||||
|
||||
UnknownProgramOption::UnknownProgramOption()
|
||||
@@ -487,11 +453,6 @@ UnknownProgramOption::UnknownProgramOption(const std::string& sMessage)
|
||||
{
|
||||
}
|
||||
|
||||
UnknownProgramOption::UnknownProgramOption(const UnknownProgramOption &inst)
|
||||
: Exception(inst)
|
||||
{
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------
|
||||
|
||||
ProgramInformation::ProgramInformation()
|
||||
@@ -509,11 +470,6 @@ ProgramInformation::ProgramInformation(const std::string& sMessage)
|
||||
{
|
||||
}
|
||||
|
||||
ProgramInformation::ProgramInformation(const ProgramInformation &inst)
|
||||
: Exception(inst)
|
||||
{
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------
|
||||
|
||||
TypeError::TypeError()
|
||||
@@ -531,11 +487,6 @@ TypeError::TypeError(const std::string& sMessage)
|
||||
{
|
||||
}
|
||||
|
||||
TypeError::TypeError(const TypeError &inst)
|
||||
: Exception(inst)
|
||||
{
|
||||
}
|
||||
|
||||
PyObject *TypeError::getPyExceptionType() const {
|
||||
return PyExc_TypeError;
|
||||
}
|
||||
@@ -557,11 +508,6 @@ ValueError::ValueError(const std::string& sMessage)
|
||||
{
|
||||
}
|
||||
|
||||
ValueError::ValueError(const ValueError &inst)
|
||||
: Exception(inst)
|
||||
{
|
||||
}
|
||||
|
||||
PyObject *ValueError::getPyExceptionType() const {
|
||||
return PyExc_ValueError;
|
||||
}
|
||||
@@ -583,11 +529,6 @@ IndexError::IndexError(const std::string& sMessage)
|
||||
{
|
||||
}
|
||||
|
||||
IndexError::IndexError(const IndexError &inst)
|
||||
: Exception(inst)
|
||||
{
|
||||
}
|
||||
|
||||
PyObject *IndexError::getPyExceptionType() const {
|
||||
return PyExc_IndexError;
|
||||
}
|
||||
@@ -609,11 +550,6 @@ NameError::NameError(const std::string& sMessage)
|
||||
{
|
||||
}
|
||||
|
||||
NameError::NameError(const NameError &inst)
|
||||
: Exception(inst)
|
||||
{
|
||||
}
|
||||
|
||||
PyObject *NameError::getPyExceptionType() const {
|
||||
return PyExc_NameError;
|
||||
}
|
||||
@@ -635,11 +571,6 @@ ImportError::ImportError(const std::string& sMessage)
|
||||
{
|
||||
}
|
||||
|
||||
ImportError::ImportError(const ImportError &inst)
|
||||
: Exception(inst)
|
||||
{
|
||||
}
|
||||
|
||||
PyObject *ImportError::getPyExceptionType() const {
|
||||
return PyExc_ImportError;
|
||||
}
|
||||
@@ -661,11 +592,6 @@ AttributeError::AttributeError(const std::string& sMessage)
|
||||
{
|
||||
}
|
||||
|
||||
AttributeError::AttributeError(const AttributeError &inst)
|
||||
: Exception(inst)
|
||||
{
|
||||
}
|
||||
|
||||
PyObject *AttributeError::getPyExceptionType() const {
|
||||
return PyExc_AttributeError;
|
||||
}
|
||||
@@ -687,11 +613,6 @@ RuntimeError::RuntimeError(const std::string& sMessage)
|
||||
{
|
||||
}
|
||||
|
||||
RuntimeError::RuntimeError(const RuntimeError &inst)
|
||||
: Exception(inst)
|
||||
{
|
||||
}
|
||||
|
||||
PyObject *RuntimeError::getPyExceptionType() const {
|
||||
return PyExc_RuntimeError;
|
||||
}
|
||||
@@ -713,11 +634,6 @@ BadGraphError::BadGraphError(const std::string& sMessage)
|
||||
{
|
||||
}
|
||||
|
||||
BadGraphError::BadGraphError(const BadGraphError &inst)
|
||||
: RuntimeError(inst)
|
||||
{
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------
|
||||
|
||||
NotImplementedError::NotImplementedError()
|
||||
@@ -735,11 +651,6 @@ NotImplementedError::NotImplementedError(const std::string& sMessage)
|
||||
{
|
||||
}
|
||||
|
||||
NotImplementedError::NotImplementedError(const NotImplementedError &inst)
|
||||
: Exception(inst)
|
||||
{
|
||||
}
|
||||
|
||||
PyObject *NotImplementedError::getPyExceptionType() const {
|
||||
return PyExc_NotImplementedError;
|
||||
}
|
||||
@@ -761,11 +672,6 @@ DivisionByZeroError::DivisionByZeroError(const std::string& sMessage)
|
||||
{
|
||||
}
|
||||
|
||||
DivisionByZeroError::DivisionByZeroError(const DivisionByZeroError &inst)
|
||||
: Exception(inst)
|
||||
{
|
||||
}
|
||||
|
||||
PyObject *DivisionByZeroError::getPyExceptionType() const {
|
||||
return PyExc_ZeroDivisionError;
|
||||
}
|
||||
@@ -787,11 +693,6 @@ ReferencesError::ReferencesError(const std::string& sMessage)
|
||||
{
|
||||
}
|
||||
|
||||
ReferencesError::ReferencesError(const ReferencesError &inst)
|
||||
: Exception(inst)
|
||||
{
|
||||
}
|
||||
|
||||
PyObject *ReferencesError::getPyExceptionType() const {
|
||||
return PyExc_ReferenceError;
|
||||
}
|
||||
@@ -813,11 +714,6 @@ ExpressionError::ExpressionError(const std::string& sMessage)
|
||||
{
|
||||
}
|
||||
|
||||
ExpressionError::ExpressionError(const ExpressionError &inst)
|
||||
: Exception(inst)
|
||||
{
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------
|
||||
|
||||
ParserError::ParserError()
|
||||
@@ -835,11 +731,6 @@ ParserError::ParserError(const std::string& sMessage)
|
||||
{
|
||||
}
|
||||
|
||||
ParserError::ParserError(const ParserError &inst)
|
||||
: Exception(inst)
|
||||
{
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------
|
||||
|
||||
UnicodeError::UnicodeError()
|
||||
@@ -857,11 +748,6 @@ UnicodeError::UnicodeError(const std::string& sMessage)
|
||||
{
|
||||
}
|
||||
|
||||
UnicodeError::UnicodeError(const UnicodeError &inst)
|
||||
: Exception(inst)
|
||||
{
|
||||
}
|
||||
|
||||
PyObject *UnicodeError::getPyExceptionType() const {
|
||||
return PyExc_UnicodeError;
|
||||
}
|
||||
@@ -883,11 +769,6 @@ OverflowError::OverflowError(const std::string& sMessage)
|
||||
{
|
||||
}
|
||||
|
||||
OverflowError::OverflowError(const OverflowError &inst)
|
||||
: Exception(inst)
|
||||
{
|
||||
}
|
||||
|
||||
PyObject *OverflowError::getPyExceptionType() const {
|
||||
return PyExc_OverflowError;
|
||||
}
|
||||
@@ -909,11 +790,6 @@ UnderflowError::UnderflowError(const std::string& sMessage)
|
||||
{
|
||||
}
|
||||
|
||||
UnderflowError::UnderflowError(const UnderflowError &inst)
|
||||
: Exception(inst)
|
||||
{
|
||||
}
|
||||
|
||||
PyObject *UnderflowError::getPyExceptionType() const {
|
||||
return PyExc_ArithmeticError;
|
||||
}
|
||||
@@ -935,11 +811,6 @@ UnitsMismatchError::UnitsMismatchError(const std::string& sMessage)
|
||||
{
|
||||
}
|
||||
|
||||
UnitsMismatchError::UnitsMismatchError(const UnitsMismatchError &inst)
|
||||
: Exception(inst)
|
||||
{
|
||||
}
|
||||
|
||||
PyObject *UnitsMismatchError::getPyExceptionType() const {
|
||||
return PyExc_ArithmeticError;
|
||||
}
|
||||
@@ -961,12 +832,6 @@ CADKernelError::CADKernelError(const std::string& sMessage)
|
||||
{
|
||||
}
|
||||
|
||||
CADKernelError::CADKernelError(const CADKernelError &inst)
|
||||
: Exception(inst)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------
|
||||
|
||||
RestoreError::RestoreError()
|
||||
@@ -984,12 +849,6 @@ RestoreError::RestoreError(const std::string& sMessage)
|
||||
{
|
||||
}
|
||||
|
||||
RestoreError::RestoreError(const RestoreError &inst)
|
||||
: Exception(inst)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
// ---------------------------------------------------------
|
||||
|
||||
#if defined(__GNUC__) && defined (FC_OS_LINUX)
|
||||
|
||||
Reference in New Issue
Block a user