This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/41830] New: Missing "warning: control reaches end of non-void function" in -O2
- From: "grxnprzn at gmx dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 26 Oct 2009 14:43:03 -0000
- Subject: [Bug c++/41830] New: Missing "warning: control reaches end of non-void function" in -O2
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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