This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/54046] [4.6/4.7/4.8 Regression] wrong control reaches end of non-void function for switch case with throw and default
- From: "jakub at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 20 Jul 2012 12:39:30 +0000
- Subject: [Bug c++/54046] [4.6/4.7/4.8 Regression] wrong control reaches end of non-void function for switch case with throw and default
- Auto-submitted: auto-generated
- References: <bug-54046-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54046
--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-07-20 12:39:30 UTC ---
void foo (void) __attribute__((noreturn));
struct A
{
~A () {}
};
bool
check (int x)
{
A z;
switch (x)
{
case 0:
return false;
default:
foo ();
break;
}
}
warns the same.