public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/98841] New: wrong ‘operator=’ should return a reference to ‘*this’ [-Weffc++]
@ 2021-01-26 17:33 o.mandel at menlosystems dot com
  2021-01-26 17:33 ` [Bug c++/98841] " o.mandel at menlosystems dot com
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: o.mandel at menlosystems dot com @ 2021-01-26 17:33 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 98841
           Summary: wrong ‘operator=’ should return a reference to ‘*this’
                    [-Weffc++]
           Product: gcc
           Version: 10.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: o.mandel at menlosystems dot com
  Target Milestone: ---

Created attachment 50059
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50059&action=edit
Console output of version 8.3.0

I get unexpected warnings about "'operator=' should return a reference to
'*this' [-Weffc++]".

This happens for at least versions 8.3.0 and 10.2.0 of g++. The output of the
following command is attached for both versions:

g++ -v -save-temps -Weffc++ -c t.cpp

In the minimal demo used here this only happens for a template member function,
but in larger code it can also be observed for a plain member function: see
e.g. https://github.com/jbeder/yaml-cpp/issues/970

This might be the same issue as mentioned in
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84364#c9 (why the comment asked
for that ticket to be reopened)?

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2021-01-29  9:15 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-26 17:33 [Bug c++/98841] New: wrong ‘operator=’ should return a reference to ‘*this’ [-Weffc++] o.mandel at menlosystems dot com
2021-01-26 17:33 ` [Bug c++/98841] " o.mandel at menlosystems dot com
2021-01-26 17:34 ` o.mandel at menlosystems dot com
2021-01-26 17:35 ` o.mandel at menlosystems dot com
2021-01-26 17:47 ` redi at gcc dot gnu.org
2021-01-26 19:04 ` pinskia at gcc dot gnu.org
2021-01-26 19:25 ` jakub at gcc dot gnu.org
2021-01-27 10:42 ` jakub at gcc dot gnu.org
2021-01-27 17:46 ` o.mandel at menlosystems dot com
2021-01-28 23:40 ` cvs-commit at gcc dot gnu.org
2021-01-28 23:41 ` jakub at gcc dot gnu.org
2021-01-29  9:15 ` o.mandel at menlosystems dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).