https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70972

--- Comment #2 from TC <rs2740 at gmail dot com> ---
Not exactly that familiar with GCC, but looking at
https://gcc.gnu.org/viewcvs/gcc/trunk/gcc/cp/method.c?r1=233719&r2=233718&pathrev=233719

  tree type = TREE_TYPE (parm);
  if (DECL_PACK_P (parm))
    type = PACK_EXPANSION_PATTERN (type);
  exp = build_static_cast (type, exp, tf_warning_or_error);

This seems to do the equivalent of `static_cast<decltype(p)>(p)` (which is a
copy) rather than the desired `static_cast<decltype(p)&&>(p)`. Consistent with
this hypothesis, with -fno-elide-constructors, a copy constructor call is
emitted *in addition to* a move constructor call
(http://coliru.stacked-crooked.com/a/5dd154da9c26472f), rather than instead of
one.

Reply via email to