Bug 22595 - [4.0 regression] wrong warning: control may reach end of non-void function
Summary: [4.0 regression] wrong warning: control may reach end of non-void function
Status: RESOLVED WONTFIX
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.0.2
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-21 17:04 UTC by Debian GCC Maintainers
Modified: 2005-07-23 22:49 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work: 3.4.4 4.1.0
Known to fail: 4.0.2
Last reconfirmed:


Attachments
testcase (100 bytes, text/x-c++src)
2005-07-21 17:05 UTC, Debian GCC Maintainers
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Debian GCC Maintainers 2005-07-21 17:04:13 UTC
[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.
Comment 1 Debian GCC Maintainers 2005-07-21 17:05:11 UTC
Created attachment 9323 [details]
testcase
Comment 2 Andrew Pinski 2005-07-21 17:10:12 UTC
This was already decided against being fixed for 4.0.x series.