From 253f36115273e739b726bd2e3b240a0fb7d83c78 Mon Sep 17 00:00:00 2001 From: Eric Schweitz Date: Tue, 9 Apr 2019 11:03:33 -0700 Subject: [PATCH] [flang] make the ctor use special type deduction so members can be moved and copied in the same call Original-commit: flang-compiler/f18@d18e8391fc9def0cf0abc54bb3bb1b68a0779764 Reviewed-on: https://github.com/flang-compiler/f18/pull/393 --- flang/lib/FIR/mixin.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/flang/lib/FIR/mixin.h b/flang/lib/FIR/mixin.h index 5a98e85d986c..9ec91055dc26 100644 --- a/flang/lib/FIR/mixin.h +++ b/flang/lib/FIR/mixin.h @@ -69,7 +69,8 @@ template struct SumTypeCopyMixin { template struct ProductTypeMixin { using ProductTypeTrait = std::true_type; ProductTypeMixin(const Ts &... x) : t{x...} {} - ProductTypeMixin(Ts &&... x) : t{std::forward(x)...} {} + template + ProductTypeMixin(As &&... x) : t{std::forward(x)...} {} ProductTypeMixin(ProductTypeMixin &&) = default; ProductTypeMixin &operator=(ProductTypeMixin &&) = default; ProductTypeMixin(const ProductTypeMixin &) = delete;