Skip to content

Commit 23f9838

Browse files
authored
Merge pull request #603 from diffblue/exception-constructors
copy constructors for exception classes
2 parents cf0f84d + e149b0e commit 23f9838

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

src/ebmc/ebmc_error.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,16 @@ Author: Daniel Kroening, dkr@amazon.com
1616
class ebmc_errort
1717
{
1818
public:
19+
ebmc_errort() = default;
20+
ebmc_errort(const ebmc_errort &other)
21+
{
22+
// ostringstream does not have a copy constructor
23+
message << other.message.str();
24+
__exit_code = other.__exit_code;
25+
__location = other.__location;
26+
}
27+
ebmc_errort(ebmc_errort &&) = default;
28+
1929
std::string what() const
2030
{
2131
return message.str();

src/verilog/verilog_preprocessor_error.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@ Author: Daniel Kroening, kroening@kroening.com
1515
class verilog_preprocessor_errort
1616
{
1717
public:
18+
verilog_preprocessor_errort() = default;
19+
verilog_preprocessor_errort(verilog_preprocessor_errort &&) = default;
20+
verilog_preprocessor_errort(const verilog_preprocessor_errort &other)
21+
{
22+
// ostringstream does not have a copy constructor
23+
message << other.message.str();
24+
}
25+
1826
std::string what() const
1927
{
2028
return message.str();

0 commit comments

Comments
 (0)