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

            Bug ID: 85523
           Summary: Add fix-it hint for missing return statement in
                    assignment operators
           Product: gcc
           Version: 8.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: enhancement
          Priority: P3
         Component: c++
          Assignee: dmalcolm at gcc dot gnu.org
          Reporter: redi at gcc dot gnu.org
  Target Milestone: ---

As discussed at https://gcc.gnu.org/ml/gcc/2018-04/msg00170.html we could offer
fix-it hints for cases like:

struct X {
  X& operator=(const X&) { } // show fix-it
};

struct Y {
  void operator=(const Y&) { }
  int operator=(int) { } // no fix-it here, just a -Wreturn-type warning
};

struct Z {
  Z& operator=(const Z& z) {
    i = z.i;
  } // show fix-it

  int i;
};

Reply via email to