gcc/testsuite/g++.dg/pr51264-4.C
raw| 1 | /* { dg-do compile } */ |
| 2 | /* { dg-options "-O0 -Werror -Wreturn-type" } */ |
| 3 | |
| 4 | /* Test-case from http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25973#c4. */ |
| 5 | |
| 6 | struct Block |
| 7 | { |
| 8 | public: |
| 9 | Block (); |
| 10 | ~Block (); |
| 11 | }; |
| 12 | |
| 13 | bool func (bool bar) |
| 14 | { |
| 15 | Block block; |
| 16 | bool foo = false; |
| 17 | |
| 18 | if (!foo || bar) |
| 19 | do |
| 20 | { |
| 21 | return true; |
| 22 | } |
| 23 | while (0); |
| 24 | else |
| 25 | do |
| 26 | { |
| 27 | return false; |
| 28 | } |
| 29 | while (0); |
| 30 | } |