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

            Bug ID: 83045
           Summary: -Wreturn-type regression in C++
           Product: gcc
           Version: 8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tschwinge at gcc dot gnu.org
                CC: marxin at gcc dot gnu.org
  Target Milestone: ---

Created attachment 42652
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42652&action=edit
rt.c

... starting with r254437 "Instrument function exit with __builtin_unreachable
in C++" (assuming that I bisected that correctly).

For "-Wreturn-type -x c" compilation of the attached rt.c, we see:

    [...]/rt.c: In function 'test1':
    [...]/rt.c:6:1: warning: control reaches end of non-void function
[-Wreturn-type]
     }
     ^
    [...]/rt.c: In function 'test2':
    [...]/rt.c:13:1: warning: control reaches end of non-void function
[-Wreturn-type]
     }
     ^

... whereas for "-Wreturn-type -x c++" compilation, we now only see:

    [...]/rt.c: In function 'int test1(int)':
    [...]/rt.c:6:1: warning: no return statement in function returning non-void
[-Wreturn-type]
     }
     ^

..., but used to see (and with r254437 reverted again see):

    [...]/rt.c: In function 'int test1(int)':
    [...]/rt.c:6:1: warning: no return statement in function returning non-void
[-Wreturn-type]
     }
     ^
    [...]/rt.c: In function 'int test2(int)':
    [...]/rt.c:13:1: warning: control reaches end of non-void function
[-Wreturn-type]
     }
     ^

Reply via email to