Skip to content

Commit da9d618

Browse files
adbridge0xc0170
authored andcommitted
Fixes issue #2508. The default compiler(ARMCC) copy constructor for failure_t doesn't behave as expected and has unexpected side effects. This fix adds a custom copy constructor to fix this.
1 parent 59dc540 commit da9d618

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

features/frameworks/utest/utest/utest_types.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,12 @@ namespace v1 {
8989
failure_t(location_t location) : reason(REASON_NONE), location(location) {}
9090
failure_t(failure_reason_t reason, location_t location) : reason(reason), location(location) {}
9191

92+
/// Copy constructor
93+
failure_t(const failure_t &obj){
94+
reason = obj.reason;
95+
location = obj.location;
96+
}
97+
9298
/// @returns a copy of the failure with the reason ignored.
9399
failure_t ignored() const {
94100
return failure_t(failure_reason_t(reason | REASON_IGNORE), location);

0 commit comments

Comments
 (0)