gcc/testsuite/gdc.test/fail_compilation/fail4375m.d
raw| 1 | // REQUIRED_ARGS: -w |
| 2 | // https://issues.dlang.org/show_bug.cgi?id=4375: Dangling else |
| 3 | /* |
| 4 | TEST_OUTPUT: |
| 5 | --- |
| 6 | fail_compilation/fail4375m.d(17): Warning: else is dangling, add { } after condition at fail_compilation/fail4375m.d(14) |
| 7 | Error: warnings are treated as errors |
| 8 | Use -wi if you wish to treat warnings only as informational. |
| 9 | --- |
| 10 | */ |
| 11 | |
| 12 | void main() { |
| 13 | do |
| 14 | if (true) |
| 15 | if (true) |
| 16 | assert(76); |
| 17 | else |
| 18 | assert(77); |
| 19 | while (false); |
| 20 | } |