pr51264-4.C: New test.

2012-04-17  Tom de Vries  <tom@codesourcery.com>

	* g++.dg/pr51264-4.C: New test.

From-SVN: r186547
This commit is contained in:
Tom de Vries 2012-04-17 18:28:50 +00:00 committed by Tom de Vries
parent b2cb7511d4
commit bd9ee48c16
2 changed files with 34 additions and 0 deletions

View File

@ -1,3 +1,7 @@
2012-04-17 Tom de Vries <tom@codesourcery.com>
* g++.dg/pr51264-4.C: New test.
2012-04-17 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/52599

View File

@ -0,0 +1,30 @@
/* { dg-do compile } */
/* { dg-options "-O0 -Werror -Wreturn-type" } */
/* Test-case from http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25973#c4. */
struct Block
{
public:
Block ();
~Block ();
};
bool func (bool bar)
{
Block block;
bool foo = false;
if (!foo || bar)
do
{
return true;
}
while (0);
else
do
{
return false;
}
while (0);
}