This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/20681] [4.3/4.4/4.5/4.6 Regression] wrong "control reaches" warning with switches
- From: "ami at fischman dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 23 Feb 2011 23:36:08 +0000
- Subject: [Bug c++/20681] [4.3/4.4/4.5/4.6 Regression] wrong "control reaches" warning with switches
- Auto-submitted: auto-generated
- References: <bug-20681-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20681
--- Comment #29 from Ami Fischman <ami at fischman dot org> 2011-02-23 23:35:45 UTC ---
Further reduced test case from dup bug 47864:
$ nl t.cc ; g++ -finstrument-functions -Wreturn-type -Werror -c t.cc
1 int foo(int type) {
2 switch(type) {
3 case 0: return 1; break;
4 default: return 0;
5 }
6 }
cc1plus: warnings being treated as errors
t.cc: In function âint foo(int)â:
t.cc:6: error: control reaches end of non-void function
(in 4.4.3)