diff --git a/include/rfl/parsing/Parser_rfl_variant.hpp b/include/rfl/parsing/Parser_rfl_variant.hpp index b47834d1..c15acc86 100644 --- a/include/rfl/parsing/Parser_rfl_variant.hpp +++ b/include/rfl/parsing/Parser_rfl_variant.hpp @@ -112,7 +112,8 @@ class Parser, ProcessorsType> { using Type = std::remove_cvref_t; auto u = ParentType::add_union(_w, _parent); using UnionType = typename ParentType::template Union; - auto p = UnionType{.index_ = _variant.index(), .union_ = &u}; + auto p = UnionType{.index_ = static_cast(_variant.index()), + .union_ = &u}; Parser::write(_w, _v, p); }, _variant); diff --git a/include/rfl/parsing/Parser_variant.hpp b/include/rfl/parsing/Parser_variant.hpp index 85489bf0..5663220c 100644 --- a/include/rfl/parsing/Parser_variant.hpp +++ b/include/rfl/parsing/Parser_variant.hpp @@ -141,7 +141,8 @@ class Parser, ProcessorsType> { using Type = std::remove_cvref_t; auto u = ParentType::add_union(_w, _parent); using UnionType = typename ParentType::template Union; - auto p = UnionType{.index_ = _variant.index(), .union_ = &u}; + auto p = UnionType{.index_ = static_cast(_variant.index()), + .union_ = &u}; Parser::write(_w, _v, p); }, _variant);