From 8f88aa0141ad95ba40fc6627e1ba8dc01aa7f9d6 Mon Sep 17 00:00:00 2001 From: John Wellbelove Date: Fri, 15 Dec 2023 10:06:21 +0000 Subject: [PATCH] Fixed etl::optional operator =() for invalid values with non-pod types --- include/etl/optional.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/etl/optional.h b/include/etl/optional.h index d85763d25..8eefd5881 100644 --- a/include/etl/optional.h +++ b/include/etl/optional.h @@ -783,7 +783,11 @@ namespace etl { if (this != &other) { - storage.value = etl::move(other.storage.value); + if (other.has_value()) + { + storage.value = etl::move(other.storage.value); + } + valid = other.valid; }