This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/63517] New: bogus Wreturn-type warning after error


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

            Bug ID: 63517
           Summary: bogus Wreturn-type warning after error
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: manu at gcc dot gnu.org

struct X{};
int foo (int x, const X& y)
{
  return x + y;
}


test.cc:4:12: error: no match for âoperator+â (operand types are âintâ and
âconst Xâ)
   return x + y;
            ^
test.cc: In function âint foo(int, const X&)â:
test.cc:5:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^

The Wreturn-type warning is bogus.

A similar issue in the  C FE is PR60440.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]