d: Merge upstream dmd, druntime 4c18eed967, phobos d945686a4.
[official-gcc.git] / gcc / testsuite / gdc.test / fail_compilation / fail4375h.d
blob04833b1bc7385d7ef4388bb6fa201f68d701db35
1 // REQUIRED_ARGS: -w
2 // https://issues.dlang.org/show_bug.cgi?id=4375: Dangling else
3 /*
4 TEST_OUTPUT:
5 ---
6 fail_compilation/fail4375h.d(18): Warning: else is dangling, add { } after condition at fail_compilation/fail4375h.d(15)
7 Error: warnings are treated as errors
8 Use -wi if you wish to treat warnings only as informational.
9 ---
12 void main() {
13 switch (4) {
14 default:
15 if (true) // disallowed
16 if (false)
17 assert(48);
18 else
19 assert(49);
20 break;