Skip to content

Commit 4f3dba4

Browse files
committed
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 862db41 commit 4f3dba4

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
@@ -88,6 +88,12 @@ namespace v1 {
8888
failure_t(location_t location) : reason(REASON_NONE), location(location) {}
8989
failure_t(failure_reason_t reason, location_t location) : reason(reason), location(location) {}
9090

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

0 commit comments

Comments
 (0)