From 4f3dba41a1f8c02279c9a8156878974e179b7f3a Mon Sep 17 00:00:00 2001 From: Anna Bridge Date: Mon, 22 Aug 2016 13:29:01 +0100 Subject: [PATCH] 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. --- features/frameworks/utest/utest/utest_types.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/features/frameworks/utest/utest/utest_types.h b/features/frameworks/utest/utest/utest_types.h index 5d07e10782..a0a3e6642a 100644 --- a/features/frameworks/utest/utest/utest_types.h +++ b/features/frameworks/utest/utest/utest_types.h @@ -88,6 +88,12 @@ namespace v1 { failure_t(location_t location) : reason(REASON_NONE), location(location) {} failure_t(failure_reason_t reason, location_t location) : reason(reason), location(location) {} + /// Copy constructor + failure_t(const failure_t &obj){ + reason = obj.reason; + location = obj.location; + } + /// @returns a copy of the failure with the reason ignored. failure_t ignored() const { return failure_t(failure_reason_t(reason | REASON_IGNORE), location);