This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/22595] New: [4.0 regression] wrong warning: control may reach end of non-void function
- From: "debian-gcc at lists dot debian dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Jul 2005 17:04:14 -0000
- Subject: [Bug c++/22595] New: [4.0 regression] wrong warning: control may reach end of non-void function
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
[forwarded from http://bugs.debian.org/319309]
regression from 3.4, fixed in 4.1
Compile the attached example source code with:
g++ -Wall -O3 -c bug.cc
g++ produces the warning:
bug.cc:9: warning: control may reach end of non-void function 'char* f(char*)'
being inlined
This is wrong, as should be obvious, since every possible control path
in f() either leads to a return or a throw. g++ 3.x correctly
analyses the code and does not generate a warning.
--
Summary: [4.0 regression] wrong warning: control may reach end of
non-void function
Product: gcc
Version: 4.0.2
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: debian-gcc at lists dot debian dot org
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22595