Fix warning C4275

It's not enough to disable this warning by adding /wd4257 at build time because it's triggered when the library is consumed.
This commit is contained in:
Osyotr
2025-10-03 14:00:20 +00:00
committed by Thomas Krijnen
parent 02713dbd39
commit 066326ab3b
9 changed files with 61 additions and 17 deletions
+7
View File
@@ -0,0 +1,7 @@
#include "IfcException.h"
IfcParse::IfcException::~IfcException() = default;
IfcParse::IfcAttributeOutOfRangeException::~IfcAttributeOutOfRangeException() = default;
IfcParse::IfcInvalidTokenException::~IfcInvalidTokenException() = default;
+4 -4
View File
@@ -41,8 +41,8 @@ class IFC_PARSE_API IfcException : public std::exception {
public:
IfcException(const std::string& message)
: message_(message) {}
virtual ~IfcException() throw() {}
virtual const char* what() const throw() {
~IfcException() override;
const char* what() const noexcept override {
return message_.c_str();
}
};
@@ -51,7 +51,7 @@ class IFC_PARSE_API IfcAttributeOutOfRangeException : public IfcException {
public:
IfcAttributeOutOfRangeException(const std::string& exception)
: IfcException(exception) {}
~IfcAttributeOutOfRangeException() throw() {}
~IfcAttributeOutOfRangeException() override;
};
class IFC_PARSE_API IfcInvalidTokenException : public IfcException {
@@ -70,7 +70,7 @@ class IFC_PARSE_API IfcInvalidTokenException : public IfcException {
: IfcException(
std::string("Unexpected '") + std::string(1, character) + "' at offset " +
boost::lexical_cast<std::string>(token_start)) {}
~IfcInvalidTokenException() throw() {}
~IfcInvalidTokenException() override;
};
} // namespace IfcParse