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: Thu, 5 Sep 2019 13:55:12 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0

On 9/5/19 12:35 PM, Carlo De Falco wrote:

I still see the following 14 instances of -Wreturn-std-move instead :

14 matches for "-Wreturn-std-move" in buffer: untitled
     412:octave/libinterp/corefcn/tril.cc:122:14: warning: local variable 'r' 
will be copied despite being returned by name [-Wreturn-std-move]
     425:octave/libinterp/corefcn/tril.cc:122:14: warning: local variable 'r' 
will be copied despite being returned by name [-Wreturn-std-move]
     438:octave/libinterp/corefcn/tril.cc:122:14: warning: local variable 'r' 
will be copied despite being returned by name [-Wreturn-std-move]
     451:octave/libinterp/corefcn/tril.cc:122:14: warning: local variable 'r' 
will be copied despite being returned by name [-Wreturn-std-move]
     467:octave/libinterp/corefcn/tril.cc:122:14: warning: local variable 'r' 
will be copied despite being returned by name [-Wreturn-std-move]
     483:octave/libinterp/corefcn/tril.cc:122:14: warning: local variable 'r' 
will be copied despite being returned by name [-Wreturn-std-move]
     499:octave/libinterp/corefcn/tril.cc:122:14: warning: local variable 'r' 
will be copied despite being returned by name [-Wreturn-std-move]
     515:octave/libinterp/corefcn/tril.cc:122:14: warning: local variable 'r' 
will be copied despite being returned by name [-Wreturn-std-move]
     531:octave/libinterp/corefcn/tril.cc:122:14: warning: local variable 'r' 
will be copied despite being returned by name [-Wreturn-std-move]
     547:octave/libinterp/corefcn/tril.cc:122:14: warning: local variable 'r' 
will be copied despite being returned by name [-Wreturn-std-move]
     563:octave/libinterp/corefcn/tril.cc:122:14: warning: local variable 'r' 
will be copied despite being returned by name [-Wreturn-std-move]
     579:octave/libinterp/corefcn/tril.cc:122:14: warning: local variable 'r' 
will be copied despite being returned by name [-Wreturn-std-move]
     595:octave/libinterp/corefcn/tril.cc:122:14: warning: local variable 'r' 
will be copied despite being returned by name [-Wreturn-std-move]
     611:octave/libinterp/corefcn/tril.cc:122:14: warning: local variable 'r' 
will be copied despite being returned by name [-Wreturn-std-move]


the full warning messages look like this :

octave/libinterp/corefcn/tril.cc:122:14: warning: local variable 'r' will be 
copied despite being returned by name [-Wreturn-std-move]
       return r;
              ^
octave/libinterp/corefcn/tril.cc:173:41: note: in instantiation of function template 
specialization 'do_triu<double>' requested here
   return lower ? do_tril (a, k, pack) : do_triu (a, k, pack);
                                         ^
octave/libinterp/corefcn/tril.cc:221:18: note: in instantiation of function template 
specialization 'do_trilu<double>' requested here
         retval = do_trilu (arg.array_value (), k, lower, pack);
                  ^
octave/libinterp/corefcn/tril.cc:122:14: note: call 'std::move' explicitly to 
avoid copying
       return r;
              ^
              std::move(r)

I'm surprised those are the only warnings, and that there is a warning on line 122 but not also for line 107 in the same function.

jwe





reply via email to

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