https://gcc.gnu.org/g:e6c0d6baf4bcb477a12cb419a32acc17448959df
commit r16-7765-ge6c0d6baf4bcb477a12cb419a32acc17448959df Author: Philip Herron <[email protected]> Date: Wed Sep 3 16:55:46 2025 +0100 gccrs: Revert "gccrs: Remove the template parameter This reverts commit a50fb38f36506e02139f3ff9343e099c2f5508d7 as it breaks gcc5 bootstrap. gcc/rust/ChangeLog: * typecheck/rust-tyty.cc (VariantDef::clone): revert (VariantDef::monomorphized_clone): likewise Signed-off-by: Philip Herron <[email protected]> Diff: --- gcc/rust/typecheck/rust-tyty.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gcc/rust/typecheck/rust-tyty.cc b/gcc/rust/typecheck/rust-tyty.cc index c2e1bf438f7b..161c15e78960 100644 --- a/gcc/rust/typecheck/rust-tyty.cc +++ b/gcc/rust/typecheck/rust-tyty.cc @@ -1698,7 +1698,8 @@ VariantDef::clone () const cloned_fields.push_back ((StructFieldType *) f->clone ()); auto &&discriminant_opt = has_discriminant () - ? tl::optional (get_discriminant ().clone_expr ()) + ? tl::optional<std::unique_ptr<HIR::Expr>> ( + get_discriminant ().clone_expr ()) : tl::nullopt; return new VariantDef (id, defid, identifier, ident, type, @@ -1713,7 +1714,8 @@ VariantDef::monomorphized_clone () const cloned_fields.push_back ((StructFieldType *) f->monomorphized_clone ()); auto discriminant_opt = has_discriminant () - ? tl::optional (get_discriminant ().clone_expr ()) + ? tl::optional<std::unique_ptr<HIR::Expr>> ( + get_discriminant ().clone_expr ()) : tl::nullopt; return new VariantDef (id, defid, identifier, ident, type,
