octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: move constructors likely a requirement


From: John W. Eaton
Subject: Re: move constructors likely a requirement
Date: Wed, 4 Sep 2019 14:14:12 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0

On 9/4/19 8:32 AM, Carlo De Falco wrote:


Il giorno 4 set 2019, alle ore 00:39, John W. Eaton <address@hidden> ha scritto:

I pushed the following changes:

  http://hg.savannah.gnu.org/hgweb/octave/rev/5bf76ab4cce3
  http://hg.savannah.gnu.org/hgweb/octave/rev/a2d3fa82b730
  http://hg.savannah.gnu.org/hgweb/octave/rev/fcaecdbc8d8a

Hi,

Since this changesets, when compiling with clang++ I see lot of warnings of the 
form :

octave/libinterp/parse-tree/pt-colon.cc:67:41: warning: moving a temporary 
object prevents copy elision
       [-Wpessimizing-move]
             octave_value ov_increment = std::move (m_increment->evaluate (tw));

AFAIU this warning means that, in this case, automatic return value 
optimization performed by the compiler
would result in code that is more efficient than that produced using move 
constructor.

I'm just reporting this in case it may be of interest, bu I don't know whether 
it is worth making any changes to
remove the warning.

It is of interest. I'd like to avoid std::move when it isn't needed. Could you send a log of all the warnings? I'm not seeing them with GCC. If I understand correctly, -Wpessimizing-move is supposed to be implied when compiling C++ code with GCC and using -Wall.

jwe



reply via email to

[Prev in Thread] Current Thread [Next in Thread]