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)?

Reply via email to