[Bug c++/59552] New: Warning when non-trivial type parameter is passed by value but not changed in function

eugene.zelenko at gmail dot com gcc-bugzilla@gcc.gnu.org
Wed Dec 18 23:10:00 GMT 2013


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59552

            Bug ID: 59552
           Summary: Warning when non-trivial type parameter is passed by
                    value but not changed in function
           Product: gcc
           Version: 4.8.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: eugene.zelenko at gmail dot com

Hi!

I think will be good idea to introduce warnings for situations when non-trivial
type (of big size or with non-default copy constructor, for example, STL
container) parameter is passed by value but not changed in function (only const
methods are called), so in this case const reference should be used instead.

Eugene.



More information about the Gcc-bugs mailing list