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++/41830] New: Missing "warning: control reaches end of non-void function" in -O2


Example: 

  class Bug {};
  const Bug bug() {}

compile with "-Wreturn-type -O1": no warning
compile with "-Wreturn-type -O2": no warning
compile with "-Wreturn-type -O3": warning printed

If I read the documentation correctly, -Wreturn type should work with or
without optimizing.


-- 
           Summary: Missing "warning: control reaches end of non-void
                    function" in -O2
           Product: gcc
           Version: 4.3.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: grxnprzn at gmx dot net
 GCC build triplet: i586-suse-linux
  GCC host triplet: i586-suse-linux
GCC target triplet: i586-suse-linux


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41830


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